From c1feee63abb6c35180e93415f168ddb3e5496bf5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:03:17 +0000 Subject: [PATCH 1/8] Initial plan From b23c4ac90ce14cdf2a8cb7a095a5b5d1e322df6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:09:16 +0000 Subject: [PATCH 2/8] feat: Add AI Model Registry and RAG Pipeline protocols with comprehensive tests Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- packages/spec/src/ai/model-registry.test.ts | 587 ++++++++++++++++++ packages/spec/src/ai/model-registry.zod.ts | 192 ++++++ packages/spec/src/ai/rag-pipeline.test.ts | 633 ++++++++++++++++++++ packages/spec/src/ai/rag-pipeline.zod.ts | 280 +++++++++ 4 files changed, 1692 insertions(+) create mode 100644 packages/spec/src/ai/model-registry.test.ts create mode 100644 packages/spec/src/ai/model-registry.zod.ts create mode 100644 packages/spec/src/ai/rag-pipeline.test.ts create mode 100644 packages/spec/src/ai/rag-pipeline.zod.ts diff --git a/packages/spec/src/ai/model-registry.test.ts b/packages/spec/src/ai/model-registry.test.ts new file mode 100644 index 0000000..e3fd341 --- /dev/null +++ b/packages/spec/src/ai/model-registry.test.ts @@ -0,0 +1,587 @@ +import { describe, it, expect } from 'vitest'; +import { + ModelProviderSchema, + ModelCapabilitySchema, + ModelLimitsSchema, + ModelPricingSchema, + ModelConfigSchema, + PromptVariableSchema, + PromptTemplateSchema, + ModelRegistryEntrySchema, + ModelRegistrySchema, + ModelSelectionCriteriaSchema, + type ModelConfig, + type PromptTemplate, + type ModelRegistry, +} from './model-registry.zod'; + +describe('ModelProviderSchema', () => { + it('should accept all valid providers', () => { + const providers = ['openai', 'azure_openai', 'anthropic', 'google', 'cohere', 'huggingface', 'local', 'custom'] as const; + + providers.forEach(provider => { + expect(() => ModelProviderSchema.parse(provider)).not.toThrow(); + }); + }); + + it('should reject invalid providers', () => { + expect(() => ModelProviderSchema.parse('invalid')).toThrow(); + }); +}); + +describe('ModelCapabilitySchema', () => { + it('should accept minimal capabilities', () => { + const capabilities = {}; + const result = ModelCapabilitySchema.parse(capabilities); + expect(result.textGeneration).toBe(true); + expect(result.textEmbedding).toBe(false); + }); + + it('should accept full capabilities', () => { + const capabilities = { + textGeneration: true, + textEmbedding: true, + imageGeneration: true, + imageUnderstanding: true, + functionCalling: true, + codeGeneration: true, + reasoning: true, + }; + expect(() => ModelCapabilitySchema.parse(capabilities)).not.toThrow(); + }); +}); + +describe('ModelLimitsSchema', () => { + it('should accept valid limits', () => { + const limits = { + maxTokens: 4096, + contextWindow: 8192, + }; + expect(() => ModelLimitsSchema.parse(limits)).not.toThrow(); + }); + + it('should accept limits with rate limiting', () => { + const limits = { + maxTokens: 4096, + contextWindow: 8192, + maxOutputTokens: 2048, + rateLimit: { + requestsPerMinute: 60, + tokensPerMinute: 100000, + }, + }; + expect(() => ModelLimitsSchema.parse(limits)).not.toThrow(); + }); + + it('should reject negative values', () => { + expect(() => ModelLimitsSchema.parse({ + maxTokens: -1, + contextWindow: 8192, + })).toThrow(); + }); +}); + +describe('ModelPricingSchema', () => { + it('should accept minimal pricing', () => { + const pricing = {}; + const result = ModelPricingSchema.parse(pricing); + expect(result.currency).toBe('USD'); + }); + + it('should accept full pricing info', () => { + const pricing = { + currency: 'USD', + inputCostPer1kTokens: 0.03, + outputCostPer1kTokens: 0.06, + embeddingCostPer1kTokens: 0.0001, + }; + expect(() => ModelPricingSchema.parse(pricing)).not.toThrow(); + }); +}); + +describe('ModelConfigSchema', () => { + it('should accept minimal model config', () => { + const model: ModelConfig = { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + functionCalling: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 128000, + }, + }; + expect(() => ModelConfigSchema.parse(model)).not.toThrow(); + }); + + it('should accept full model config', () => { + const model: ModelConfig = { + id: 'claude-3-opus', + name: 'Claude 3 Opus', + version: 'claude-3-opus-20240229', + provider: 'anthropic', + capabilities: { + textGeneration: true, + imageUnderstanding: true, + functionCalling: true, + codeGeneration: true, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 200000, + maxOutputTokens: 4096, + }, + pricing: { + currency: 'USD', + inputCostPer1kTokens: 0.015, + outputCostPer1kTokens: 0.075, + }, + endpoint: 'https://api.anthropic.com/v1', + apiKey: 'sk-ant-...', + description: 'Most capable Claude model', + tags: ['reasoning', 'coding', 'analysis'], + recommendedFor: ['complex_reasoning', 'code_generation', 'long_context'], + }; + expect(() => ModelConfigSchema.parse(model)).not.toThrow(); + }); + + it('should accept embedding model', () => { + const model: ModelConfig = { + id: 'text-embedding-3-large', + name: 'Text Embedding 3 Large', + version: 'text-embedding-3-large', + provider: 'openai', + capabilities: { + textGeneration: false, + textEmbedding: true, + }, + limits: { + maxTokens: 8191, + contextWindow: 8191, + }, + pricing: { + embeddingCostPer1kTokens: 0.00013, + }, + }; + expect(() => ModelConfigSchema.parse(model)).not.toThrow(); + }); +}); + +describe('PromptVariableSchema', () => { + it('should accept minimal variable', () => { + const variable = { + name: 'user_name', + }; + const result = PromptVariableSchema.parse(variable); + expect(result.type).toBe('string'); + expect(result.required).toBe(false); + }); + + it('should accept full variable with validation', () => { + const variable = { + name: 'email', + type: 'string' as const, + required: true, + description: 'User email address', + validation: { + pattern: '^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$', + maxLength: 100, + }, + }; + expect(() => PromptVariableSchema.parse(variable)).not.toThrow(); + }); +}); + +describe('PromptTemplateSchema', () => { + it('should accept minimal prompt template', () => { + const template: PromptTemplate = { + id: 'template-1', + name: 'support_response', + label: 'Support Response', + user: 'Customer question: {{question}}', + }; + const result = PromptTemplateSchema.parse(template); + expect(result.version).toBe('1.0.0'); + }); + + it('should enforce snake_case for template name', () => { + const validNames = ['support_agent', 'code_generator', 'data_analyst']; + validNames.forEach(name => { + expect(() => PromptTemplateSchema.parse({ + id: 'test', + name, + label: 'Test', + user: 'test', + })).not.toThrow(); + }); + + const invalidNames = ['supportAgent', 'Support-Agent', '123template']; + invalidNames.forEach(name => { + expect(() => PromptTemplateSchema.parse({ + id: 'test', + name, + label: 'Test', + user: 'test', + })).toThrow(); + }); + }); + + it('should accept full prompt template', () => { + const template: PromptTemplate = { + id: 'code-generator-v1', + name: 'code_generator', + label: 'Code Generator', + system: 'You are an expert software engineer.', + user: 'Generate {{language}} code for: {{description}}', + assistant: 'Here is the code:', + variables: [ + { + name: 'language', + type: 'string', + required: true, + validation: { + enum: ['python', 'javascript', 'typescript', 'java'], + }, + }, + { + name: 'description', + type: 'string', + required: true, + validation: { + minLength: 10, + maxLength: 500, + }, + }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.7, + maxTokens: 2048, + version: '1.0.0', + description: 'Generate code from natural language description', + category: 'code_generation', + tags: ['coding', 'generation'], + examples: [ + { + input: { + language: 'python', + description: 'function to sort a list', + }, + output: 'def sort_list(items):\n return sorted(items)', + }, + ], + }; + expect(() => PromptTemplateSchema.parse(template)).not.toThrow(); + }); + + it('should accept template with model parameters', () => { + const template: PromptTemplate = { + id: 'creative-writer', + name: 'creative_writer', + label: 'Creative Writer', + user: 'Write a story about: {{topic}}', + temperature: 1.2, + maxTokens: 4096, + topP: 0.95, + frequencyPenalty: 0.5, + presencePenalty: 0.5, + stopSequences: ['THE END', '---'], + }; + expect(() => PromptTemplateSchema.parse(template)).not.toThrow(); + }); +}); + +describe('ModelRegistryEntrySchema', () => { + it('should accept minimal registry entry', () => { + const entry = { + model: { + id: 'gpt-4', + name: 'GPT-4', + version: 'gpt-4-0613', + provider: 'openai', + capabilities: {}, + limits: { + maxTokens: 8192, + contextWindow: 8192, + }, + }, + }; + const result = ModelRegistryEntrySchema.parse(entry); + expect(result.status).toBe('active'); + expect(result.priority).toBe(0); + }); + + it('should accept entry with fallbacks and health check', () => { + const entry = { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: {}, + limits: { + maxTokens: 4096, + contextWindow: 128000, + }, + }, + status: 'active' as const, + priority: 10, + fallbackModels: ['gpt-4', 'gpt-3.5-turbo'], + healthCheck: { + enabled: true, + intervalSeconds: 300, + lastChecked: '2024-01-15T10:00:00Z', + status: 'healthy' as const, + }, + }; + expect(() => ModelRegistryEntrySchema.parse(entry)).not.toThrow(); + }); +}); + +describe('ModelRegistrySchema', () => { + it('should accept minimal registry', () => { + const registry: ModelRegistry = { + name: 'default', + models: { + 'gpt-4': { + model: { + id: 'gpt-4', + name: 'GPT-4', + version: 'gpt-4-0613', + provider: 'openai', + capabilities: {}, + limits: { + maxTokens: 8192, + contextWindow: 8192, + }, + }, + }, + }, + }; + const result = ModelRegistrySchema.parse(registry); + expect(result.enableAutoFallback).toBe(true); + }); + + it('should accept full registry with templates', () => { + const registry: ModelRegistry = { + name: 'production', + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + functionCalling: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 128000, + }, + }, + status: 'active', + priority: 10, + }, + 'claude-3-opus': { + model: { + id: 'claude-3-opus', + name: 'Claude 3 Opus', + version: 'claude-3-opus-20240229', + provider: 'anthropic', + capabilities: { + textGeneration: true, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 200000, + }, + }, + status: 'active', + priority: 5, + }, + }, + promptTemplates: { + support_agent: { + id: 'support-1', + name: 'support_agent', + label: 'Support Agent', + system: 'You are a helpful support agent.', + user: 'Customer question: {{question}}', + modelId: 'gpt-4-turbo', + }, + }, + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, + }; + expect(() => ModelRegistrySchema.parse(registry)).not.toThrow(); + }); +}); + +describe('ModelSelectionCriteriaSchema', () => { + it('should accept minimal criteria', () => { + const criteria = {}; + const result = ModelSelectionCriteriaSchema.parse(criteria); + expect(result.excludeDeprecated).toBe(true); + }); + + it('should accept full criteria', () => { + const criteria = { + capabilities: ['textGeneration', 'functionCalling'], + maxCostPer1kTokens: 0.05, + minContextWindow: 32000, + provider: 'openai' as const, + tags: ['reasoning', 'coding'], + excludeDeprecated: true, + }; + expect(() => ModelSelectionCriteriaSchema.parse(criteria)).not.toThrow(); + }); +}); + +describe('Real-World Model Registry Examples', () => { + it('should accept enterprise model registry', () => { + const registry: ModelRegistry = { + name: 'enterprise-production', + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'azure_openai', + capabilities: { + textGeneration: true, + functionCalling: true, + codeGeneration: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 128000, + rateLimit: { + requestsPerMinute: 100, + tokensPerMinute: 150000, + }, + }, + pricing: { + inputCostPer1kTokens: 0.01, + outputCostPer1kTokens: 0.03, + }, + endpoint: 'https://mycompany.openai.azure.com', + region: 'eastus', + tags: ['production', 'general-purpose'], + }, + status: 'active', + priority: 10, + fallbackModels: ['gpt-35-turbo'], + healthCheck: { + enabled: true, + intervalSeconds: 180, + status: 'healthy', + }, + }, + 'claude-3-opus': { + model: { + id: 'claude-3-opus', + name: 'Claude 3 Opus', + version: 'claude-3-opus-20240229', + provider: 'anthropic', + capabilities: { + textGeneration: true, + imageUnderstanding: true, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 200000, + }, + pricing: { + inputCostPer1kTokens: 0.015, + outputCostPer1kTokens: 0.075, + }, + tags: ['analysis', 'reasoning'], + }, + status: 'active', + priority: 8, + }, + 'llama-70b': { + model: { + id: 'llama-70b', + name: 'Llama 2 70B', + version: '70b-chat-v2', + provider: 'local', + capabilities: { + textGeneration: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 4096, + }, + endpoint: 'http://localhost:8080/v1', + tags: ['local', 'open-source'], + }, + status: 'experimental', + priority: 1, + }, + }, + promptTemplates: { + code_generator: { + id: 'code-gen-v2', + name: 'code_generator', + label: 'Code Generator', + system: 'You are an expert software engineer specializing in ObjectStack development.', + user: 'Generate {{language}} code for: {{task}}\n\nRequirements:\n{{requirements}}', + variables: [ + { + name: 'language', + type: 'string', + required: true, + }, + { + name: 'task', + type: 'string', + required: true, + }, + { + name: 'requirements', + type: 'string', + required: false, + }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.3, + category: 'code_generation', + }, + support_agent: { + id: 'support-v1', + name: 'support_agent', + label: 'Support Agent', + system: 'You are a helpful customer support agent. Be empathetic and solution-oriented.', + user: 'Customer: {{customer_name}}\nIssue: {{issue}}\nHistory: {{history}}', + modelId: 'gpt-4-turbo', + temperature: 0.7, + category: 'support', + }, + data_analyst: { + id: 'analyst-v1', + name: 'data_analyst', + label: 'Data Analyst', + system: 'You are a business intelligence analyst. Provide data-driven insights.', + user: 'Analyze the following data and provide insights:\n{{data}}\n\nFocus on: {{focus_areas}}', + modelId: 'claude-3-opus', + temperature: 0.3, + category: 'analytics', + }, + }, + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, + }; + + expect(() => ModelRegistrySchema.parse(registry)).not.toThrow(); + }); +}); diff --git a/packages/spec/src/ai/model-registry.zod.ts b/packages/spec/src/ai/model-registry.zod.ts new file mode 100644 index 0000000..1ddce99 --- /dev/null +++ b/packages/spec/src/ai/model-registry.zod.ts @@ -0,0 +1,192 @@ +import { z } from 'zod'; + +/** + * AI Model Registry Protocol + * + * Centralized registry for managing AI models, prompt templates, and model versioning. + * Enables AI-powered ObjectStack applications to discover and use LLMs consistently. + */ + +/** + * Model Provider Type + */ +export const ModelProviderSchema = z.enum([ + 'openai', + 'azure_openai', + 'anthropic', + 'google', + 'cohere', + 'huggingface', + 'local', + 'custom', +]); + +/** + * Model Capability + */ +export const ModelCapabilitySchema = z.object({ + textGeneration: z.boolean().default(true).describe('Supports text generation'), + textEmbedding: z.boolean().default(false).describe('Supports text embedding'), + imageGeneration: z.boolean().default(false).describe('Supports image generation'), + imageUnderstanding: z.boolean().default(false).describe('Supports image understanding'), + functionCalling: z.boolean().default(false).describe('Supports function calling'), + codeGeneration: z.boolean().default(false).describe('Supports code generation'), + reasoning: z.boolean().default(false).describe('Supports advanced reasoning'), +}); + +/** + * Model Limits + */ +export const ModelLimitsSchema = z.object({ + maxTokens: z.number().int().positive().describe('Maximum tokens per request'), + contextWindow: z.number().int().positive().describe('Context window size'), + maxOutputTokens: z.number().int().positive().optional().describe('Maximum output tokens'), + rateLimit: z.object({ + requestsPerMinute: z.number().int().positive().optional(), + tokensPerMinute: z.number().int().positive().optional(), + }).optional(), +}); + +/** + * Model Pricing + */ +export const ModelPricingSchema = z.object({ + currency: z.string().default('USD'), + inputCostPer1kTokens: z.number().optional().describe('Cost per 1K input tokens'), + outputCostPer1kTokens: z.number().optional().describe('Cost per 1K output tokens'), + embeddingCostPer1kTokens: z.number().optional().describe('Cost per 1K embedding tokens'), +}); + +/** + * Model Configuration + */ +export const ModelConfigSchema = z.object({ + /** Identity */ + id: z.string().describe('Unique model identifier'), + name: z.string().describe('Model display name'), + version: z.string().describe('Model version (e.g., "gpt-4-turbo-2024-04-09")'), + provider: ModelProviderSchema, + + /** Capabilities */ + capabilities: ModelCapabilitySchema, + limits: ModelLimitsSchema, + + /** Pricing */ + pricing: ModelPricingSchema.optional(), + + /** Configuration */ + endpoint: z.string().url().optional().describe('Custom API endpoint'), + apiKey: z.string().optional().describe('API key or reference to secret'), + region: z.string().optional().describe('Deployment region (e.g., "us-east-1")'), + + /** Metadata */ + description: z.string().optional(), + tags: z.array(z.string()).optional().describe('Tags for categorization'), + deprecated: z.boolean().default(false), + recommendedFor: z.array(z.string()).optional().describe('Use case recommendations'), +}); + +/** + * Prompt Template Variable + */ +export const PromptVariableSchema = z.object({ + name: z.string().describe('Variable name (e.g., "user_name", "context")'), + type: z.enum(['string', 'number', 'boolean', 'object', 'array']).default('string'), + required: z.boolean().default(false), + defaultValue: z.any().optional(), + description: z.string().optional(), + validation: z.object({ + minLength: z.number().optional(), + maxLength: z.number().optional(), + pattern: z.string().optional(), + enum: z.array(z.any()).optional(), + }).optional(), +}); + +/** + * Prompt Template + */ +export const PromptTemplateSchema = z.object({ + /** Identity */ + id: z.string().describe('Unique template identifier'), + name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Template name (snake_case)'), + label: z.string().describe('Display name'), + + /** Template Content */ + system: z.string().optional().describe('System prompt'), + user: z.string().describe('User prompt template with variables'), + assistant: z.string().optional().describe('Assistant message prefix'), + + /** Variables */ + variables: z.array(PromptVariableSchema).optional().describe('Template variables'), + + /** Model Configuration */ + modelId: z.string().optional().describe('Recommended model ID'), + temperature: z.number().min(0).max(2).optional(), + maxTokens: z.number().optional(), + topP: z.number().optional(), + frequencyPenalty: z.number().optional(), + presencePenalty: z.number().optional(), + stopSequences: z.array(z.string()).optional(), + + /** Metadata */ + version: z.string().default('1.0.0'), + description: z.string().optional(), + category: z.string().optional().describe('Template category (e.g., "code_generation", "support")'), + tags: z.array(z.string()).optional(), + examples: z.array(z.object({ + input: z.record(z.any()).describe('Example variable values'), + output: z.string().describe('Expected output'), + })).optional(), +}); + +/** + * Model Registry Entry + */ +export const ModelRegistryEntrySchema = z.object({ + model: ModelConfigSchema, + status: z.enum(['active', 'deprecated', 'experimental', 'disabled']).default('active'), + priority: z.number().int().default(0).describe('Priority for model selection'), + fallbackModels: z.array(z.string()).optional().describe('Fallback model IDs'), + healthCheck: z.object({ + enabled: z.boolean().default(true), + intervalSeconds: z.number().int().default(300), + lastChecked: z.string().optional().describe('ISO timestamp'), + status: z.enum(['healthy', 'unhealthy', 'unknown']).default('unknown'), + }).optional(), +}); + +/** + * Model Registry + */ +export const ModelRegistrySchema = z.object({ + name: z.string().describe('Registry name'), + models: z.record(ModelRegistryEntrySchema).describe('Model entries by ID'), + promptTemplates: z.record(PromptTemplateSchema).optional().describe('Prompt templates by name'), + defaultModel: z.string().optional().describe('Default model ID'), + enableAutoFallback: z.boolean().default(true).describe('Auto-fallback on errors'), +}); + +/** + * Model Selection Criteria + */ +export const ModelSelectionCriteriaSchema = z.object({ + capabilities: z.array(z.string()).optional().describe('Required capabilities'), + maxCostPer1kTokens: z.number().optional().describe('Maximum acceptable cost'), + minContextWindow: z.number().optional().describe('Minimum context window size'), + provider: ModelProviderSchema.optional(), + tags: z.array(z.string()).optional(), + excludeDeprecated: z.boolean().default(true), +}); + +// Type exports +export type ModelProvider = z.infer; +export type ModelCapability = z.infer; +export type ModelLimits = z.infer; +export type ModelPricing = z.infer; +export type ModelConfig = z.infer; +export type PromptVariable = z.infer; +export type PromptTemplate = z.infer; +export type ModelRegistryEntry = z.infer; +export type ModelRegistry = z.infer; +export type ModelSelectionCriteria = z.infer; diff --git a/packages/spec/src/ai/rag-pipeline.test.ts b/packages/spec/src/ai/rag-pipeline.test.ts new file mode 100644 index 0000000..86bed97 --- /dev/null +++ b/packages/spec/src/ai/rag-pipeline.test.ts @@ -0,0 +1,633 @@ +import { describe, it, expect } from 'vitest'; +import { + VectorStoreProviderSchema, + EmbeddingModelSchema, + ChunkingStrategySchema, + DocumentMetadataSchema, + DocumentChunkSchema, + RetrievalStrategySchema, + RerankingConfigSchema, + VectorStoreConfigSchema, + DocumentLoaderConfigSchema, + RAGPipelineConfigSchema, + RAGQueryRequestSchema, + RAGQueryResponseSchema, + RAGPipelineStatusSchema, + type EmbeddingModel, + type RAGPipelineConfig, + type RAGQueryRequest, +} from './rag-pipeline.zod'; + +describe('VectorStoreProviderSchema', () => { + it('should accept all valid providers', () => { + const providers = ['pinecone', 'weaviate', 'qdrant', 'milvus', 'chroma', 'pgvector', 'redis', 'opensearch', 'elasticsearch', 'custom'] as const; + + providers.forEach(provider => { + expect(() => VectorStoreProviderSchema.parse(provider)).not.toThrow(); + }); + }); +}); + +describe('EmbeddingModelSchema', () => { + it('should accept minimal embedding model', () => { + const model: EmbeddingModel = { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + }; + const result = EmbeddingModelSchema.parse(model); + expect(result.batchSize).toBe(100); + }); + + it('should accept full embedding model config', () => { + const model: EmbeddingModel = { + provider: 'azure_openai', + model: 'text-embedding-ada-002', + dimensions: 1536, + maxTokens: 8191, + batchSize: 50, + endpoint: 'https://mycompany.openai.azure.com', + apiKey: 'sk-...', + }; + expect(() => EmbeddingModelSchema.parse(model)).not.toThrow(); + }); +}); + +describe('ChunkingStrategySchema', () => { + it('should accept fixed chunking strategy', () => { + const strategy = { + type: 'fixed', + chunkSize: 512, + chunkOverlap: 50, + unit: 'tokens', + }; + expect(() => ChunkingStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept semantic chunking strategy', () => { + const strategy = { + type: 'semantic', + model: 'sentence-transformers', + minChunkSize: 100, + maxChunkSize: 1000, + }; + expect(() => ChunkingStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept recursive chunking strategy', () => { + const strategy = { + type: 'recursive', + separators: ['\n\n', '\n', ' '], + chunkSize: 1000, + chunkOverlap: 100, + }; + expect(() => ChunkingStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept markdown chunking strategy', () => { + const strategy = { + type: 'markdown', + maxChunkSize: 1500, + respectHeaders: true, + respectCodeBlocks: true, + }; + expect(() => ChunkingStrategySchema.parse(strategy)).not.toThrow(); + }); +}); + +describe('DocumentMetadataSchema', () => { + it('should accept minimal metadata', () => { + const metadata = { + source: '/docs/user-guide.md', + }; + expect(() => DocumentMetadataSchema.parse(metadata)).not.toThrow(); + }); + + it('should accept full metadata', () => { + const metadata = { + source: 'https://docs.example.com/api', + sourceType: 'url' as const, + title: 'API Documentation', + author: 'Engineering Team', + createdAt: '2024-01-01T00:00:00Z', + updatedAt: '2024-01-15T10:00:00Z', + tags: ['api', 'reference', 'v2'], + category: 'documentation', + language: 'en', + custom: { + version: '2.0', + deprecated: false, + }, + }; + expect(() => DocumentMetadataSchema.parse(metadata)).not.toThrow(); + }); +}); + +describe('DocumentChunkSchema', () => { + it('should accept document chunk', () => { + const chunk = { + id: 'chunk-001', + content: 'This is the content of the first chunk.', + metadata: { + source: '/docs/file.md', + }, + chunkIndex: 0, + }; + expect(() => DocumentChunkSchema.parse(chunk)).not.toThrow(); + }); + + it('should accept chunk with embedding', () => { + const chunk = { + id: 'chunk-002', + content: 'Second chunk with embedding.', + embedding: [0.1, 0.2, 0.3, 0.4, 0.5], + metadata: { + source: '/docs/file.md', + sourceType: 'file' as const, + }, + chunkIndex: 1, + tokens: 15, + }; + expect(() => DocumentChunkSchema.parse(chunk)).not.toThrow(); + }); +}); + +describe('RetrievalStrategySchema', () => { + it('should accept similarity retrieval', () => { + const strategy = { + type: 'similarity', + topK: 5, + scoreThreshold: 0.7, + }; + expect(() => RetrievalStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept MMR retrieval', () => { + const strategy = { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.5, + }; + expect(() => RetrievalStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept hybrid retrieval', () => { + const strategy = { + type: 'hybrid', + topK: 10, + vectorWeight: 0.7, + keywordWeight: 0.3, + }; + expect(() => RetrievalStrategySchema.parse(strategy)).not.toThrow(); + }); + + it('should accept parent document retrieval', () => { + const strategy = { + type: 'parent_document', + topK: 3, + retrieveParent: true, + }; + expect(() => RetrievalStrategySchema.parse(strategy)).not.toThrow(); + }); +}); + +describe('RerankingConfigSchema', () => { + it('should accept disabled reranking', () => { + const config = { + enabled: false, + }; + expect(() => RerankingConfigSchema.parse(config)).not.toThrow(); + }); + + it('should accept enabled reranking with model', () => { + const config = { + enabled: true, + model: 'rerank-english-v2.0', + provider: 'cohere' as const, + topK: 3, + }; + expect(() => RerankingConfigSchema.parse(config)).not.toThrow(); + }); +}); + +describe('VectorStoreConfigSchema', () => { + it('should accept minimal vector store config', () => { + const config = { + provider: 'pinecone' as const, + indexName: 'my-index', + dimensions: 1536, + }; + const result = VectorStoreConfigSchema.parse(config); + expect(result.metric).toBe('cosine'); + expect(result.batchSize).toBe(100); + }); + + it('should accept full vector store config', () => { + const config = { + provider: 'qdrant' as const, + indexName: 'knowledge-base', + namespace: 'production', + host: 'localhost', + port: 6333, + apiKey: 'api-key-123', + dimensions: 1536, + metric: 'cosine' as const, + batchSize: 50, + connectionPoolSize: 20, + timeout: 60000, + }; + expect(() => VectorStoreConfigSchema.parse(config)).not.toThrow(); + }); +}); + +describe('DocumentLoaderConfigSchema', () => { + it('should accept file loader', () => { + const loader = { + type: 'file' as const, + source: '/path/to/document.pdf', + }; + expect(() => DocumentLoaderConfigSchema.parse(loader)).not.toThrow(); + }); + + it('should accept directory loader with options', () => { + const loader = { + type: 'directory' as const, + source: '/docs', + fileTypes: ['.md', '.txt', '.pdf'], + recursive: true, + maxFileSize: 10485760, // 10MB + excludePatterns: ['**/node_modules/**', '**/.git/**'], + extractImages: true, + extractTables: true, + }; + expect(() => DocumentLoaderConfigSchema.parse(loader)).not.toThrow(); + }); + + it('should accept API loader', () => { + const loader = { + type: 'api' as const, + source: 'https://api.example.com/documents', + loaderConfig: { + headers: { + 'Authorization': 'Bearer token', + }, + pagination: true, + }, + }; + expect(() => DocumentLoaderConfigSchema.parse(loader)).not.toThrow(); + }); +}); + +describe('RAGPipelineConfigSchema', () => { + it('should accept minimal pipeline config', () => { + const config: RAGPipelineConfig = { + name: 'basic_rag', + label: 'Basic RAG Pipeline', + embedding: { + provider: 'openai', + model: 'text-embedding-3-small', + dimensions: 1536, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'docs-index', + dimensions: 1536, + }, + chunking: { + type: 'fixed', + chunkSize: 512, + }, + retrieval: { + type: 'similarity', + topK: 5, + }, + }; + const result = RAGPipelineConfigSchema.parse(config); + expect(result.maxContextTokens).toBe(4000); + expect(result.enableCache).toBe(true); + }); + + it('should enforce snake_case for pipeline name', () => { + const validNames = ['support_docs', 'api_reference', 'user_guide']; + validNames.forEach(name => { + expect(() => RAGPipelineConfigSchema.parse({ + name, + label: 'Test', + embedding: { + provider: 'openai', + model: 'text-embedding-3-small', + dimensions: 1536, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'test', + dimensions: 1536, + }, + chunking: { + type: 'fixed', + chunkSize: 512, + }, + retrieval: { + type: 'similarity', + }, + })).not.toThrow(); + }); + + const invalidNames = ['supportDocs', 'Support-Docs', '123docs']; + invalidNames.forEach(name => { + expect(() => RAGPipelineConfigSchema.parse({ + name, + label: 'Test', + embedding: { + provider: 'openai', + model: 'text-embedding-3-small', + dimensions: 1536, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'test', + dimensions: 1536, + }, + chunking: { + type: 'fixed', + chunkSize: 512, + }, + retrieval: { + type: 'similarity', + }, + })).toThrow(); + }); + }); + + it('should accept full pipeline config', () => { + const config: RAGPipelineConfig = { + name: 'enterprise_kb', + label: 'Enterprise Knowledge Base', + description: 'RAG pipeline for company documentation', + embedding: { + provider: 'azure_openai', + model: 'text-embedding-ada-002', + dimensions: 1536, + batchSize: 100, + endpoint: 'https://mycompany.openai.azure.com', + }, + vectorStore: { + provider: 'qdrant', + indexName: 'enterprise-kb', + namespace: 'production', + host: 'qdrant.example.com', + port: 6333, + dimensions: 1536, + metric: 'cosine', + }, + chunking: { + type: 'markdown', + maxChunkSize: 1000, + respectHeaders: true, + respectCodeBlocks: true, + }, + retrieval: { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.6, + }, + reranking: { + enabled: true, + model: 'rerank-english-v2.0', + provider: 'cohere', + topK: 3, + }, + loaders: [ + { + type: 'directory', + source: '/docs', + fileTypes: ['.md', '.txt'], + recursive: true, + }, + { + type: 'url', + source: 'https://docs.example.com', + }, + ], + maxContextTokens: 8000, + contextWindow: 128000, + metadataFilters: { + language: 'en', + category: 'public', + }, + enableCache: true, + cacheTTL: 7200, + }; + expect(() => RAGPipelineConfigSchema.parse(config)).not.toThrow(); + }); +}); + +describe('RAGQueryRequestSchema', () => { + it('should accept minimal query request', () => { + const request: RAGQueryRequest = { + query: 'How do I create a new object?', + pipelineName: 'support_docs', + }; + const result = RAGQueryRequestSchema.parse(request); + expect(result.includeMetadata).toBe(true); + expect(result.includeSources).toBe(true); + }); + + it('should accept full query request', () => { + const request: RAGQueryRequest = { + query: 'How do I configure authentication?', + pipelineName: 'api_docs', + topK: 10, + metadataFilters: { + category: 'security', + version: '2.0', + }, + conversationHistory: [ + { + role: 'user', + content: 'Tell me about authentication', + }, + { + role: 'assistant', + content: 'ObjectStack supports multiple authentication methods...', + }, + ], + includeMetadata: true, + includeSources: true, + }; + expect(() => RAGQueryRequestSchema.parse(request)).not.toThrow(); + }); +}); + +describe('RAGQueryResponseSchema', () => { + it('should accept query response', () => { + const response = { + query: 'How do I create objects?', + results: [ + { + content: 'To create an object, define a schema...', + score: 0.89, + metadata: { + source: '/docs/objects.md', + title: 'Object Creation Guide', + }, + chunkId: 'chunk-123', + }, + { + content: 'Objects are the foundation...', + score: 0.82, + metadata: { + source: '/docs/concepts.md', + }, + chunkId: 'chunk-456', + }, + ], + context: 'To create an object, define a schema...\n\nObjects are the foundation...', + tokensUsed: 1500, + retrievalTime: 250, + }; + expect(() => RAGQueryResponseSchema.parse(response)).not.toThrow(); + }); +}); + +describe('RAGPipelineStatusSchema', () => { + it('should accept pipeline status', () => { + const status = { + name: 'support_kb', + status: 'active' as const, + documentsIndexed: 1250, + lastIndexed: '2024-01-15T10:00:00Z', + health: { + vectorStore: 'healthy' as const, + embeddingService: 'healthy' as const, + }, + }; + expect(() => RAGPipelineStatusSchema.parse(status)).not.toThrow(); + }); + + it('should accept error status', () => { + const status = { + name: 'failed_pipeline', + status: 'error' as const, + documentsIndexed: 500, + errorMessage: 'Failed to connect to vector store', + health: { + vectorStore: 'unhealthy' as const, + embeddingService: 'healthy' as const, + }, + }; + expect(() => RAGPipelineStatusSchema.parse(status)).not.toThrow(); + }); +}); + +describe('Real-World RAG Pipeline Examples', () => { + it('should accept production support pipeline', () => { + const config: RAGPipelineConfig = { + name: 'customer_support_kb', + label: 'Customer Support Knowledge Base', + description: 'RAG pipeline for customer support documentation and FAQs', + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + batchSize: 100, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'support-kb-prod', + namespace: 'v2', + dimensions: 3072, + metric: 'cosine', + batchSize: 100, + }, + chunking: { + type: 'recursive', + separators: ['\n\n', '\n', '. ', ' '], + chunkSize: 800, + chunkOverlap: 100, + }, + retrieval: { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.7, + }, + reranking: { + enabled: true, + model: 'rerank-english-v3.0', + provider: 'cohere', + topK: 3, + }, + loaders: [ + { + type: 'directory', + source: '/knowledge-base/docs', + fileTypes: ['.md', '.txt', '.pdf'], + recursive: true, + maxFileSize: 5242880, + excludePatterns: ['**/archive/**', '**/drafts/**'], + extractTables: true, + }, + ], + maxContextTokens: 6000, + contextWindow: 128000, + metadataFilters: { + status: 'published', + language: 'en', + }, + enableCache: true, + cacheTTL: 3600, + }; + + expect(() => RAGPipelineConfigSchema.parse(config)).not.toThrow(); + }); + + it('should accept code documentation pipeline', () => { + const config: RAGPipelineConfig = { + name: 'api_reference_rag', + label: 'API Reference RAG', + description: 'RAG pipeline for API documentation with code examples', + embedding: { + provider: 'cohere', + model: 'embed-english-v3.0', + dimensions: 1024, + }, + vectorStore: { + provider: 'weaviate', + indexName: 'ApiDocs', + host: 'weaviate.example.com', + dimensions: 1024, + metric: 'cosine', + }, + chunking: { + type: 'markdown', + maxChunkSize: 1500, + respectHeaders: true, + respectCodeBlocks: true, + }, + retrieval: { + type: 'hybrid', + topK: 8, + vectorWeight: 0.8, + keywordWeight: 0.2, + }, + loaders: [ + { + type: 'api', + source: 'https://api.example.com/docs', + loaderConfig: { + authToken: 'token-123', + format: 'openapi', + }, + }, + ], + maxContextTokens: 4000, + enableCache: true, + cacheTTL: 7200, + }; + + expect(() => RAGPipelineConfigSchema.parse(config)).not.toThrow(); + }); +}); diff --git a/packages/spec/src/ai/rag-pipeline.zod.ts b/packages/spec/src/ai/rag-pipeline.zod.ts new file mode 100644 index 0000000..790fa4f --- /dev/null +++ b/packages/spec/src/ai/rag-pipeline.zod.ts @@ -0,0 +1,280 @@ +import { z } from 'zod'; + +/** + * RAG (Retrieval-Augmented Generation) Pipeline Protocol + * + * Defines schemas for building context-aware AI assistants using RAG techniques. + * Enables vector search, document chunking, embeddings, and retrieval configuration. + */ + +/** + * Vector Store Provider + */ +export const VectorStoreProviderSchema = z.enum([ + 'pinecone', + 'weaviate', + 'qdrant', + 'milvus', + 'chroma', + 'pgvector', + 'redis', + 'opensearch', + 'elasticsearch', + 'custom', +]); + +/** + * Embedding Model + */ +export const EmbeddingModelSchema = z.object({ + provider: z.enum(['openai', 'cohere', 'huggingface', 'azure_openai', 'local', 'custom']), + model: z.string().describe('Model name (e.g., "text-embedding-3-large")'), + dimensions: z.number().int().positive().describe('Embedding vector dimensions'), + maxTokens: z.number().int().positive().optional().describe('Maximum tokens per embedding'), + batchSize: z.number().int().positive().default(100).describe('Batch size for embedding'), + endpoint: z.string().url().optional().describe('Custom endpoint URL'), + apiKey: z.string().optional().describe('API key or reference to secret'), +}); + +/** + * Text Chunking Strategy + */ +export const ChunkingStrategySchema = z.discriminatedUnion('type', [ + z.object({ + type: z.literal('fixed'), + chunkSize: z.number().int().positive().describe('Fixed chunk size in tokens/chars'), + chunkOverlap: z.number().int().min(0).default(0).describe('Overlap between chunks'), + unit: z.enum(['tokens', 'characters']).default('tokens'), + }), + z.object({ + type: z.literal('semantic'), + model: z.string().optional().describe('Model for semantic chunking'), + minChunkSize: z.number().int().positive().default(100), + maxChunkSize: z.number().int().positive().default(1000), + }), + z.object({ + type: z.literal('recursive'), + separators: z.array(z.string()).default(['\n\n', '\n', ' ', '']), + chunkSize: z.number().int().positive(), + chunkOverlap: z.number().int().min(0).default(0), + }), + z.object({ + type: z.literal('markdown'), + maxChunkSize: z.number().int().positive().default(1000), + respectHeaders: z.boolean().default(true).describe('Keep headers with content'), + respectCodeBlocks: z.boolean().default(true).describe('Keep code blocks intact'), + }), +]); + +/** + * Document Metadata Schema + */ +export const DocumentMetadataSchema = z.object({ + source: z.string().describe('Document source (file path, URL, etc.)'), + sourceType: z.enum(['file', 'url', 'api', 'database', 'custom']).optional(), + title: z.string().optional(), + author: z.string().optional(), + createdAt: z.string().optional().describe('ISO timestamp'), + updatedAt: z.string().optional().describe('ISO timestamp'), + tags: z.array(z.string()).optional(), + category: z.string().optional(), + language: z.string().optional().describe('Document language (ISO 639-1 code)'), + custom: z.record(z.any()).optional().describe('Custom metadata fields'), +}); + +/** + * Document Chunk + */ +export const DocumentChunkSchema = z.object({ + id: z.string().describe('Unique chunk identifier'), + content: z.string().describe('Chunk text content'), + embedding: z.array(z.number()).optional().describe('Embedding vector'), + metadata: DocumentMetadataSchema, + chunkIndex: z.number().int().min(0).describe('Chunk position in document'), + tokens: z.number().int().optional().describe('Token count'), +}); + +/** + * Retrieval Strategy + */ +export const RetrievalStrategySchema = z.discriminatedUnion('type', [ + z.object({ + type: z.literal('similarity'), + topK: z.number().int().positive().default(5).describe('Number of results to retrieve'), + scoreThreshold: z.number().min(0).max(1).optional().describe('Minimum similarity score'), + }), + z.object({ + type: z.literal('mmr'), + topK: z.number().int().positive().default(5), + fetchK: z.number().int().positive().default(20).describe('Initial fetch size'), + lambda: z.number().min(0).max(1).default(0.5).describe('Diversity vs relevance (0=diverse, 1=relevant)'), + }), + z.object({ + type: z.literal('hybrid'), + topK: z.number().int().positive().default(5), + vectorWeight: z.number().min(0).max(1).default(0.7).describe('Weight for vector search'), + keywordWeight: z.number().min(0).max(1).default(0.3).describe('Weight for keyword search'), + }), + z.object({ + type: z.literal('parent_document'), + topK: z.number().int().positive().default(5), + retrieveParent: z.boolean().default(true).describe('Retrieve full parent document'), + }), +]); + +/** + * Reranking Configuration + */ +export const RerankingConfigSchema = z.object({ + enabled: z.boolean().default(false), + model: z.string().optional().describe('Reranking model name'), + provider: z.enum(['cohere', 'huggingface', 'custom']).optional(), + topK: z.number().int().positive().optional().describe('Final number of results after reranking'), +}); + +/** + * Vector Store Configuration + */ +export const VectorStoreConfigSchema = z.object({ + provider: VectorStoreProviderSchema, + indexName: z.string().describe('Index/collection name'), + namespace: z.string().optional().describe('Namespace for multi-tenancy'), + + /** Connection */ + host: z.string().optional().describe('Vector store host'), + port: z.number().int().optional().describe('Vector store port'), + apiKey: z.string().optional().describe('API key or reference to secret'), + + /** Configuration */ + dimensions: z.number().int().positive().describe('Vector dimensions'), + metric: z.enum(['cosine', 'euclidean', 'dotproduct']).default('cosine'), + + /** Performance */ + batchSize: z.number().int().positive().default(100), + connectionPoolSize: z.number().int().positive().default(10), + timeout: z.number().int().positive().default(30000).describe('Timeout in milliseconds'), +}); + +/** + * Document Loader Configuration + */ +export const DocumentLoaderConfigSchema = z.object({ + type: z.enum(['file', 'directory', 'url', 'api', 'database', 'custom']), + + /** Source */ + source: z.string().describe('Source path, URL, or identifier'), + + /** File Types */ + fileTypes: z.array(z.string()).optional().describe('Accepted file extensions (e.g., [".pdf", ".md"])'), + + /** Processing */ + recursive: z.boolean().default(false).describe('Process directories recursively'), + maxFileSize: z.number().int().optional().describe('Maximum file size in bytes'), + excludePatterns: z.array(z.string()).optional().describe('Patterns to exclude'), + + /** Text Extraction */ + extractImages: z.boolean().default(false).describe('Extract text from images (OCR)'), + extractTables: z.boolean().default(false).describe('Extract and format tables'), + + /** Custom Loader */ + loaderConfig: z.record(z.any()).optional().describe('Custom loader-specific config'), +}); + +/** + * RAG Pipeline Configuration + */ +export const RAGPipelineConfigSchema = z.object({ + /** Identity */ + name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Pipeline name (snake_case)'), + label: z.string().describe('Display name'), + description: z.string().optional(), + + /** Components */ + embedding: EmbeddingModelSchema, + vectorStore: VectorStoreConfigSchema, + chunking: ChunkingStrategySchema, + retrieval: RetrievalStrategySchema, + reranking: RerankingConfigSchema.optional(), + + /** Document Loading */ + loaders: z.array(DocumentLoaderConfigSchema).optional().describe('Document loaders'), + + /** Context Management */ + maxContextTokens: z.number().int().positive().default(4000).describe('Maximum tokens in context'), + contextWindow: z.number().int().positive().optional().describe('LLM context window size'), + + /** Metadata Filtering */ + metadataFilters: z.record(z.any()).optional().describe('Filters for retrieval'), + + /** Caching */ + enableCache: z.boolean().default(true), + cacheTTL: z.number().int().positive().default(3600).describe('Cache TTL in seconds'), +}); + +/** + * RAG Query Request + */ +export const RAGQueryRequestSchema = z.object({ + query: z.string().describe('User query'), + pipelineName: z.string().describe('Pipeline to use'), + + /** Override defaults */ + topK: z.number().int().positive().optional(), + metadataFilters: z.record(z.any()).optional(), + + /** Context */ + conversationHistory: z.array(z.object({ + role: z.enum(['user', 'assistant', 'system']), + content: z.string(), + })).optional(), + + /** Options */ + includeMetadata: z.boolean().default(true), + includeSources: z.boolean().default(true), +}); + +/** + * RAG Query Response + */ +export const RAGQueryResponseSchema = z.object({ + query: z.string(), + results: z.array(z.object({ + content: z.string(), + score: z.number(), + metadata: DocumentMetadataSchema.optional(), + chunkId: z.string().optional(), + })), + context: z.string().describe('Assembled context for LLM'), + tokensUsed: z.number().int().optional(), + retrievalTime: z.number().optional().describe('Retrieval time in milliseconds'), +}); + +/** + * RAG Pipeline Status + */ +export const RAGPipelineStatusSchema = z.object({ + name: z.string(), + status: z.enum(['active', 'indexing', 'error', 'disabled']), + documentsIndexed: z.number().int().min(0), + lastIndexed: z.string().optional().describe('ISO timestamp'), + errorMessage: z.string().optional(), + health: z.object({ + vectorStore: z.enum(['healthy', 'unhealthy', 'unknown']), + embeddingService: z.enum(['healthy', 'unhealthy', 'unknown']), + }).optional(), +}); + +// Type exports +export type VectorStoreProvider = z.infer; +export type EmbeddingModel = z.infer; +export type ChunkingStrategy = z.infer; +export type DocumentMetadata = z.infer; +export type DocumentChunk = z.infer; +export type RetrievalStrategy = z.infer; +export type RerankingConfig = z.infer; +export type VectorStoreConfig = z.infer; +export type DocumentLoaderConfig = z.infer; +export type RAGPipelineConfig = z.infer; +export type RAGQueryRequest = z.infer; +export type RAGQueryResponse = z.infer; +export type RAGPipelineStatus = z.infer; From 5d73b22dd8c253005207bb1d162145416c9b76df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:11:50 +0000 Subject: [PATCH 3/8] feat: Add Natural Language Query protocol and update exports (82 total AI tests passing) Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- packages/spec/src/ai/nlq.test.ts | 594 +++++++++++++++++++++++++++++++ packages/spec/src/ai/nlq.zod.ts | 303 ++++++++++++++++ packages/spec/src/index.ts | 5 +- 3 files changed, 901 insertions(+), 1 deletion(-) create mode 100644 packages/spec/src/ai/nlq.test.ts create mode 100644 packages/spec/src/ai/nlq.zod.ts diff --git a/packages/spec/src/ai/nlq.test.ts b/packages/spec/src/ai/nlq.test.ts new file mode 100644 index 0000000..fbdfdd6 --- /dev/null +++ b/packages/spec/src/ai/nlq.test.ts @@ -0,0 +1,594 @@ +import { describe, it, expect } from 'vitest'; +import { + QueryIntentSchema, + EntitySchema, + TimeframeSchema, + FieldMappingSchema, + QueryContextSchema, + NLQParseResultSchema, + NLQRequestSchema, + NLQResponseSchema, + NLQTrainingExampleSchema, + NLQModelConfigSchema, + NLQAnalyticsSchema, + FieldSynonymConfigSchema, + QueryTemplateSchema, + type NLQRequest, + type NLQResponse, + type NLQParseResult, +} from './nlq.zod'; + +describe('QueryIntentSchema', () => { + it('should accept all valid intents', () => { + const intents = ['select', 'aggregate', 'filter', 'sort', 'compare', 'trend', 'insight', 'create', 'update', 'delete'] as const; + + intents.forEach(intent => { + expect(() => QueryIntentSchema.parse(intent)).not.toThrow(); + }); + }); +}); + +describe('EntitySchema', () => { + it('should accept entity with all fields', () => { + const entity = { + type: 'object' as const, + text: 'accounts', + value: 'account', + confidence: 0.95, + span: [8, 16] as [number, number], + }; + expect(() => EntitySchema.parse(entity)).not.toThrow(); + }); + + it('should accept entity without optional fields', () => { + const entity = { + type: 'field' as const, + text: 'customer name', + value: 'account.name', + confidence: 0.88, + }; + expect(() => EntitySchema.parse(entity)).not.toThrow(); + }); +}); + +describe('TimeframeSchema', () => { + it('should accept absolute timeframe', () => { + const timeframe = { + type: 'absolute' as const, + start: '2024-01-01T00:00:00Z', + end: '2024-01-31T23:59:59Z', + text: 'January 2024', + }; + expect(() => TimeframeSchema.parse(timeframe)).not.toThrow(); + }); + + it('should accept relative timeframe', () => { + const timeframe = { + type: 'relative' as const, + relative: { + unit: 'month' as const, + value: 1, + direction: 'past' as const, + }, + text: 'last month', + }; + expect(() => TimeframeSchema.parse(timeframe)).not.toThrow(); + }); +}); + +describe('FieldMappingSchema', () => { + it('should accept field mapping', () => { + const mapping = { + naturalLanguage: 'customer name', + objectField: 'account.name', + object: 'account', + field: 'name', + confidence: 0.92, + }; + expect(() => FieldMappingSchema.parse(mapping)).not.toThrow(); + }); +}); + +describe('QueryContextSchema', () => { + it('should accept minimal context', () => { + const context = {}; + const result = QueryContextSchema.parse(context); + expect(result.defaultLimit).toBe(100); + expect(result.timezone).toBe('UTC'); + expect(result.locale).toBe('en-US'); + }); + + it('should accept full context', () => { + const context = { + userId: 'user-123', + userRole: 'sales_manager', + currentObject: 'account', + currentRecordId: 'acc-456', + conversationHistory: [ + { + query: 'show me all accounts', + timestamp: '2024-01-15T10:00:00Z', + intent: 'select' as const, + }, + ], + defaultLimit: 50, + timezone: 'America/New_York', + locale: 'en-US', + }; + expect(() => QueryContextSchema.parse(context)).not.toThrow(); + }); +}); + +describe('NLQParseResultSchema', () => { + it('should accept parse result', () => { + const result: NLQParseResult = { + originalQuery: 'show me all accounts created last month', + intent: 'select', + intentConfidence: 0.95, + entities: [ + { + type: 'object', + text: 'accounts', + value: 'account', + confidence: 0.98, + }, + { + type: 'timeframe', + text: 'last month', + value: { unit: 'month', value: 1 }, + confidence: 0.92, + }, + ], + targetObject: 'account', + fields: [ + { + naturalLanguage: 'accounts', + objectField: 'account', + object: 'account', + field: '*', + confidence: 0.98, + }, + ], + timeframe: { + type: 'relative', + relative: { + unit: 'month', + value: 1, + direction: 'past', + }, + text: 'last month', + }, + ast: { + object: 'account', + fields: ['*'], + filters: [['created_date', '>=', '2023-12-01']], + }, + confidence: 0.93, + }; + expect(() => NLQParseResultSchema.parse(result)).not.toThrow(); + }); + + it('should accept parse result with ambiguities', () => { + const result: NLQParseResult = { + originalQuery: 'show me accounts', + intent: 'select', + intentConfidence: 0.85, + entities: [], + targetObject: 'account', + ast: { object: 'account' }, + confidence: 0.85, + ambiguities: [ + { + type: 'field_selection', + description: 'No specific fields mentioned', + suggestions: ['All fields', 'Default view fields', 'Summary fields'], + }, + ], + }; + expect(() => NLQParseResultSchema.parse(result)).not.toThrow(); + }); + + it('should accept parse result with alternatives', () => { + const result: NLQParseResult = { + originalQuery: 'show tasks', + intent: 'select', + intentConfidence: 0.8, + entities: [], + targetObject: 'task', + ast: { object: 'task' }, + confidence: 0.8, + alternatives: [ + { + interpretation: 'Show all tasks', + confidence: 0.8, + ast: { object: 'task', fields: ['*'] }, + }, + { + interpretation: 'Show my tasks', + confidence: 0.7, + ast: { object: 'task', filters: [['assigned_to', '=', 'current_user']] }, + }, + ], + }; + expect(() => NLQParseResultSchema.parse(result)).not.toThrow(); + }); +}); + +describe('NLQRequestSchema', () => { + it('should accept minimal request', () => { + const request: NLQRequest = { + query: 'show me all accounts', + }; + const result = NLQRequestSchema.parse(request); + expect(result.includeAlternatives).toBe(false); + expect(result.maxAlternatives).toBe(3); + expect(result.minConfidence).toBe(0.5); + expect(result.executeQuery).toBe(false); + }); + + it('should accept full request', () => { + const request: NLQRequest = { + query: 'what are the top 10 opportunities by value?', + context: { + userId: 'user-123', + currentObject: 'opportunity', + defaultLimit: 10, + }, + includeAlternatives: true, + maxAlternatives: 5, + minConfidence: 0.7, + executeQuery: true, + maxResults: 10, + }; + expect(() => NLQRequestSchema.parse(request)).not.toThrow(); + }); +}); + +describe('NLQResponseSchema', () => { + it('should accept response without execution', () => { + const response: NLQResponse = { + parseResult: { + originalQuery: 'show accounts', + intent: 'select', + intentConfidence: 0.9, + entities: [], + targetObject: 'account', + ast: { object: 'account' }, + confidence: 0.9, + }, + needsClarification: false, + }; + expect(() => NLQResponseSchema.parse(response)).not.toThrow(); + }); + + it('should accept response with execution results', () => { + const response: NLQResponse = { + parseResult: { + originalQuery: 'show accounts', + intent: 'select', + intentConfidence: 0.9, + entities: [], + targetObject: 'account', + ast: { object: 'account' }, + confidence: 0.9, + }, + results: [ + { id: '1', name: 'Acme Corp', industry: 'Technology' }, + { id: '2', name: 'Globex Inc', industry: 'Manufacturing' }, + ], + totalCount: 2, + executionTime: 150, + needsClarification: false, + }; + expect(() => NLQResponseSchema.parse(response)).not.toThrow(); + }); + + it('should accept response needing clarification', () => { + const response: NLQResponse = { + parseResult: { + originalQuery: 'show accounts', + intent: 'select', + intentConfidence: 0.6, + entities: [], + targetObject: 'account', + ast: { object: 'account' }, + confidence: 0.6, + ambiguities: [ + { + type: 'field_selection', + description: 'Which fields do you want to see?', + }, + ], + }, + needsClarification: true, + suggestions: [ + 'Show all accounts with name and industry', + 'Show active accounts only', + 'Show accounts created this month', + ], + }; + expect(() => NLQResponseSchema.parse(response)).not.toThrow(); + }); +}); + +describe('NLQTrainingExampleSchema', () => { + it('should accept training example', () => { + const example = { + query: 'show me all accounts created last month', + expectedIntent: 'select' as const, + expectedObject: 'account', + expectedAST: { + object: 'account', + filters: [['created_date', '>=', '2023-12-01']], + }, + category: 'basic_select', + tags: ['select', 'timeframe'], + notes: 'Basic select with relative timeframe', + }; + expect(() => NLQTrainingExampleSchema.parse(example)).not.toThrow(); + }); +}); + +describe('NLQModelConfigSchema', () => { + it('should accept minimal config', () => { + const config = { + modelId: 'gpt-4-turbo', + }; + const result = NLQModelConfigSchema.parse(config); + expect(result.includeSchema).toBe(true); + expect(result.enableIntentDetection).toBe(true); + expect(result.enableCaching).toBe(true); + }); + + it('should accept full config', () => { + const config = { + modelId: 'gpt-4-turbo', + systemPrompt: 'You are an expert at converting natural language to ObjectQL queries.', + includeSchema: true, + includeExamples: true, + enableIntentDetection: true, + intentThreshold: 0.8, + enableEntityRecognition: true, + entityRecognitionModel: 'ner-model-v1', + enableFuzzyMatching: true, + fuzzyMatchThreshold: 0.85, + enableTimeframeDetection: true, + defaultTimeframe: 'current_month', + enableCaching: true, + cacheTTL: 7200, + }; + expect(() => NLQModelConfigSchema.parse(config)).not.toThrow(); + }); +}); + +describe('NLQAnalyticsSchema', () => { + it('should accept analytics data', () => { + const analytics = { + totalQueries: 1000, + successfulQueries: 850, + failedQueries: 150, + averageConfidence: 0.87, + intentDistribution: { + select: 500, + aggregate: 200, + filter: 150, + sort: 100, + compare: 50, + }, + topQueries: [ + { + query: 'show me all accounts', + count: 150, + averageConfidence: 0.95, + }, + { + query: 'total revenue by region', + count: 120, + averageConfidence: 0.92, + }, + ], + averageParseTime: 250, + averageExecutionTime: 500, + lowConfidenceQueries: [ + { + query: 'show stuff', + confidence: 0.45, + timestamp: '2024-01-15T10:00:00Z', + }, + ], + startDate: '2024-01-01T00:00:00Z', + endDate: '2024-01-31T23:59:59Z', + }; + expect(() => NLQAnalyticsSchema.parse(analytics)).not.toThrow(); + }); +}); + +describe('FieldSynonymConfigSchema', () => { + it('should accept field synonym config', () => { + const config = { + object: 'account', + field: 'name', + synonyms: ['customer name', 'company name', 'organization name', 'account name'], + examples: [ + 'show accounts by customer name', + 'find companies with name containing Acme', + ], + }; + expect(() => FieldSynonymConfigSchema.parse(config)).not.toThrow(); + }); +}); + +describe('QueryTemplateSchema', () => { + it('should accept query template', () => { + const template = { + id: 'template-1', + name: 'top_n_by_field', + label: 'Top N Records by Field', + pattern: 'top {n} {object} by {field}', + variables: [ + { name: 'n', type: 'value' as const, required: true }, + { name: 'object', type: 'object' as const, required: true }, + { name: 'field', type: 'field' as const, required: true }, + ], + astTemplate: { + object: '{object}', + sort: [{ field: '{field}', order: 'desc' }], + limit: '{n}', + }, + category: 'ranking', + examples: [ + 'top 10 accounts by revenue', + 'top 5 opportunities by amount', + ], + tags: ['sort', 'limit', 'ranking'], + }; + expect(() => QueryTemplateSchema.parse(template)).not.toThrow(); + }); + + it('should enforce snake_case for template name', () => { + const validNames = ['top_n_by_field', 'filter_by_date', 'aggregate_sum']; + validNames.forEach(name => { + expect(() => QueryTemplateSchema.parse({ + id: 'test', + name, + label: 'Test', + pattern: 'test', + variables: [], + astTemplate: {}, + })).not.toThrow(); + }); + + const invalidNames = ['topNByField', 'Top-N-By-Field', '123template']; + invalidNames.forEach(name => { + expect(() => QueryTemplateSchema.parse({ + id: 'test', + name, + label: 'Test', + pattern: 'test', + variables: [], + astTemplate: {}, + })).toThrow(); + }); + }); +}); + +describe('Real-World NLQ Examples', () => { + it('should accept sales query example', () => { + const request: NLQRequest = { + query: 'show me all opportunities worth more than $100k closed this quarter', + context: { + userId: 'user-123', + userRole: 'sales_manager', + currentObject: 'opportunity', + timezone: 'America/New_York', + }, + executeQuery: true, + maxResults: 50, + }; + + const response: NLQResponse = { + parseResult: { + originalQuery: request.query, + intent: 'select', + intentConfidence: 0.94, + entities: [ + { type: 'object', text: 'opportunities', value: 'opportunity', confidence: 0.98 }, + { type: 'field', text: 'worth', value: 'amount', confidence: 0.92 }, + { type: 'value', text: '$100k', value: 100000, confidence: 0.95 }, + { type: 'field', text: 'closed', value: 'stage', confidence: 0.88 }, + { type: 'timeframe', text: 'this quarter', value: { unit: 'quarter', value: 0 }, confidence: 0.96 }, + ], + targetObject: 'opportunity', + fields: [ + { naturalLanguage: 'opportunities', objectField: 'opportunity.*', object: 'opportunity', field: '*', confidence: 0.98 }, + { naturalLanguage: 'worth', objectField: 'opportunity.amount', object: 'opportunity', field: 'amount', confidence: 0.92 }, + ], + timeframe: { + type: 'relative', + relative: { unit: 'quarter', value: 0, direction: 'current' }, + text: 'this quarter', + }, + ast: { + object: 'opportunity', + fields: ['*'], + filters: [ + ['amount', '>', 100000], + 'and', + ['stage', '=', 'Closed Won'], + 'and', + ['close_date', '>=', '2024-01-01'], + 'and', + ['close_date', '<=', '2024-03-31'], + ], + sort: [{ field: 'amount', order: 'desc' }], + }, + confidence: 0.93, + }, + results: [ + { id: '1', name: 'Enterprise Deal', amount: 250000, stage: 'Closed Won', close_date: '2024-02-15' }, + { id: '2', name: 'Strategic Partnership', amount: 180000, stage: 'Closed Won', close_date: '2024-01-20' }, + ], + totalCount: 2, + executionTime: 320, + needsClarification: false, + }; + + expect(() => NLQRequestSchema.parse(request)).not.toThrow(); + expect(() => NLQResponseSchema.parse(response)).not.toThrow(); + }); + + it('should accept analytics query example', () => { + const request: NLQRequest = { + query: 'what is the total revenue by region for last year?', + context: { + userId: 'analyst-456', + userRole: 'data_analyst', + }, + executeQuery: true, + }; + + const response: NLQResponse = { + parseResult: { + originalQuery: request.query, + intent: 'aggregate', + intentConfidence: 0.97, + entities: [ + { type: 'function', text: 'total', value: 'sum', confidence: 0.96 }, + { type: 'field', text: 'revenue', value: 'amount', confidence: 0.94 }, + { type: 'field', text: 'region', value: 'region', confidence: 0.98 }, + ], + targetObject: 'opportunity', + timeframe: { + type: 'relative', + relative: { unit: 'year', value: 1, direction: 'past' }, + text: 'last year', + }, + ast: { + object: 'opportunity', + fields: ['region', { function: 'sum', field: 'amount', alias: 'total_revenue' }], + filters: [ + ['stage', '=', 'Closed Won'], + 'and', + ['close_date', '>=', '2023-01-01'], + 'and', + ['close_date', '<=', '2023-12-31'], + ], + groupBy: ['region'], + sort: [{ field: 'total_revenue', order: 'desc' }], + }, + confidence: 0.95, + }, + results: [ + { region: 'North America', total_revenue: 5000000 }, + { region: 'Europe', total_revenue: 3500000 }, + { region: 'Asia Pacific', total_revenue: 2800000 }, + ], + totalCount: 3, + executionTime: 450, + needsClarification: false, + }; + + expect(() => NLQRequestSchema.parse(request)).not.toThrow(); + expect(() => NLQResponseSchema.parse(response)).not.toThrow(); + }); +}); diff --git a/packages/spec/src/ai/nlq.zod.ts b/packages/spec/src/ai/nlq.zod.ts new file mode 100644 index 0000000..e3a0fa9 --- /dev/null +++ b/packages/spec/src/ai/nlq.zod.ts @@ -0,0 +1,303 @@ +import { z } from 'zod'; + +/** + * Natural Language Query (NLQ) Protocol + * + * Transforms natural language queries into ObjectQL AST (Abstract Syntax Tree). + * Enables business users to query data using natural language instead of writing code. + */ + +/** + * Query Intent Type + */ +export const QueryIntentSchema = z.enum([ + 'select', // Retrieve data (e.g., "show me all accounts") + 'aggregate', // Aggregation (e.g., "total revenue by region") + 'filter', // Filter data (e.g., "accounts created last month") + 'sort', // Sort data (e.g., "top 10 opportunities by value") + 'compare', // Compare values (e.g., "compare this quarter vs last quarter") + 'trend', // Analyze trends (e.g., "sales trend over time") + 'insight', // Generate insights (e.g., "what's unusual about this data") + 'create', // Create record (e.g., "create a new task") + 'update', // Update record (e.g., "mark this as complete") + 'delete', // Delete record (e.g., "remove this contact") +]); + +/** + * Entity Recognition + */ +export const EntitySchema = z.object({ + type: z.enum(['object', 'field', 'value', 'operator', 'function', 'timeframe']), + text: z.string().describe('Original text from query'), + value: z.any().describe('Normalized value'), + confidence: z.number().min(0).max(1).describe('Confidence score'), + span: z.tuple([z.number(), z.number()]).optional().describe('Character span in query'), +}); + +/** + * Timeframe Detection + */ +export const TimeframeSchema = z.object({ + type: z.enum(['absolute', 'relative']), + start: z.string().optional().describe('Start date (ISO format)'), + end: z.string().optional().describe('End date (ISO format)'), + relative: z.object({ + unit: z.enum(['hour', 'day', 'week', 'month', 'quarter', 'year']), + value: z.number().int(), + direction: z.enum(['past', 'future', 'current']).default('past'), + }).optional(), + text: z.string().describe('Original timeframe text'), +}); + +/** + * Field Mapping + */ +export const FieldMappingSchema = z.object({ + naturalLanguage: z.string().describe('NL field name (e.g., "customer name")'), + objectField: z.string().describe('Actual field name (e.g., "account.name")'), + object: z.string().describe('Object name'), + field: z.string().describe('Field name'), + confidence: z.number().min(0).max(1), +}); + +/** + * Query Context + */ +export const QueryContextSchema = z.object({ + /** User Information */ + userId: z.string().optional(), + userRole: z.string().optional(), + + /** Current Context */ + currentObject: z.string().optional().describe('Current object being viewed'), + currentRecordId: z.string().optional().describe('Current record ID'), + + /** Conversation History */ + conversationHistory: z.array(z.object({ + query: z.string(), + timestamp: z.string(), + intent: QueryIntentSchema.optional(), + })).optional(), + + /** Preferences */ + defaultLimit: z.number().int().default(100), + timezone: z.string().default('UTC'), + locale: z.string().default('en-US'), +}); + +/** + * NLQ Parse Result + */ +export const NLQParseResultSchema = z.object({ + /** Original Query */ + originalQuery: z.string(), + + /** Intent Detection */ + intent: QueryIntentSchema, + intentConfidence: z.number().min(0).max(1), + + /** Entity Recognition */ + entities: z.array(EntitySchema), + + /** Object & Field Resolution */ + targetObject: z.string().optional().describe('Primary object to query'), + fields: z.array(FieldMappingSchema).optional(), + + /** Temporal Information */ + timeframe: TimeframeSchema.optional(), + + /** Query AST */ + ast: z.any().describe('Generated ObjectQL AST'), + + /** Metadata */ + confidence: z.number().min(0).max(1).describe('Overall confidence'), + ambiguities: z.array(z.object({ + type: z.string(), + description: z.string(), + suggestions: z.array(z.string()).optional(), + })).optional().describe('Detected ambiguities requiring clarification'), + + /** Alternative Interpretations */ + alternatives: z.array(z.object({ + interpretation: z.string(), + confidence: z.number(), + ast: z.any(), + })).optional(), +}); + +/** + * NLQ Request + */ +export const NLQRequestSchema = z.object({ + /** Query */ + query: z.string().describe('Natural language query'), + + /** Context */ + context: QueryContextSchema.optional(), + + /** Options */ + includeAlternatives: z.boolean().default(false).describe('Include alternative interpretations'), + maxAlternatives: z.number().int().default(3), + minConfidence: z.number().min(0).max(1).default(0.5).describe('Minimum confidence threshold'), + + /** Execution */ + executeQuery: z.boolean().default(false).describe('Execute query and return results'), + maxResults: z.number().int().optional().describe('Maximum results to return'), +}); + +/** + * NLQ Response + */ +export const NLQResponseSchema = z.object({ + /** Parse Result */ + parseResult: NLQParseResultSchema, + + /** Query Results (if executeQuery = true) */ + results: z.array(z.record(z.any())).optional().describe('Query results'), + totalCount: z.number().int().optional(), + + /** Execution Metadata */ + executionTime: z.number().optional().describe('Execution time in milliseconds'), + needsClarification: z.boolean().describe('Whether query needs clarification'), + + /** Suggestions */ + suggestions: z.array(z.string()).optional().describe('Query refinement suggestions'), +}); + +/** + * NLQ Training Example + */ +export const NLQTrainingExampleSchema = z.object({ + /** Input */ + query: z.string().describe('Natural language query'), + context: QueryContextSchema.optional(), + + /** Expected Output */ + expectedIntent: QueryIntentSchema, + expectedObject: z.string().optional(), + expectedAST: z.any().describe('Expected ObjectQL AST'), + + /** Metadata */ + category: z.string().optional().describe('Example category'), + tags: z.array(z.string()).optional(), + notes: z.string().optional(), +}); + +/** + * NLQ Model Configuration + */ +export const NLQModelConfigSchema = z.object({ + /** Model */ + modelId: z.string().describe('Model from registry'), + + /** Prompt Engineering */ + systemPrompt: z.string().optional().describe('System prompt override'), + includeSchema: z.boolean().default(true).describe('Include object schema in prompt'), + includeExamples: z.boolean().default(true).describe('Include examples in prompt'), + + /** Intent Detection */ + enableIntentDetection: z.boolean().default(true), + intentThreshold: z.number().min(0).max(1).default(0.7), + + /** Entity Recognition */ + enableEntityRecognition: z.boolean().default(true), + entityRecognitionModel: z.string().optional(), + + /** Field Resolution */ + enableFuzzyMatching: z.boolean().default(true).describe('Fuzzy match field names'), + fuzzyMatchThreshold: z.number().min(0).max(1).default(0.8), + + /** Temporal Processing */ + enableTimeframeDetection: z.boolean().default(true), + defaultTimeframe: z.string().optional().describe('Default timeframe if not specified'), + + /** Performance */ + enableCaching: z.boolean().default(true), + cacheTTL: z.number().int().default(3600).describe('Cache TTL in seconds'), +}); + +/** + * NLQ Analytics + */ +export const NLQAnalyticsSchema = z.object({ + /** Query Metrics */ + totalQueries: z.number().int(), + successfulQueries: z.number().int(), + failedQueries: z.number().int(), + averageConfidence: z.number().min(0).max(1), + + /** Intent Distribution */ + intentDistribution: z.record(z.number().int()).describe('Count by intent type'), + + /** Common Patterns */ + topQueries: z.array(z.object({ + query: z.string(), + count: z.number().int(), + averageConfidence: z.number(), + })), + + /** Performance */ + averageParseTime: z.number().describe('Average parse time in milliseconds'), + averageExecutionTime: z.number().optional(), + + /** Issues */ + lowConfidenceQueries: z.array(z.object({ + query: z.string(), + confidence: z.number(), + timestamp: z.string(), + })), + + /** Timeframe */ + startDate: z.string().describe('ISO timestamp'), + endDate: z.string().describe('ISO timestamp'), +}); + +/** + * Field Synonym Configuration + */ +export const FieldSynonymConfigSchema = z.object({ + object: z.string().describe('Object name'), + field: z.string().describe('Field name'), + synonyms: z.array(z.string()).describe('Natural language synonyms'), + examples: z.array(z.string()).optional().describe('Example queries using synonyms'), +}); + +/** + * Query Template + */ +export const QueryTemplateSchema = z.object({ + id: z.string(), + name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Template name (snake_case)'), + label: z.string(), + + /** Template */ + pattern: z.string().describe('Query pattern with placeholders'), + variables: z.array(z.object({ + name: z.string(), + type: z.enum(['object', 'field', 'value', 'timeframe']), + required: z.boolean().default(false), + })), + + /** Generated AST */ + astTemplate: z.any().describe('AST template with variable placeholders'), + + /** Metadata */ + category: z.string().optional(), + examples: z.array(z.string()).optional(), + tags: z.array(z.string()).optional(), +}); + +// Type exports +export type QueryIntent = z.infer; +export type Entity = z.infer; +export type Timeframe = z.infer; +export type FieldMapping = z.infer; +export type QueryContext = z.infer; +export type NLQParseResult = z.infer; +export type NLQRequest = z.infer; +export type NLQResponse = z.infer; +export type NLQTrainingExample = z.infer; +export type NLQModelConfig = z.infer; +export type NLQAnalytics = z.infer; +export type FieldSynonymConfig = z.infer; +export type QueryTemplate = z.infer; diff --git a/packages/spec/src/index.ts b/packages/spec/src/index.ts index 6bb1aab..8c0479c 100644 --- a/packages/spec/src/index.ts +++ b/packages/spec/src/index.ts @@ -24,8 +24,11 @@ export * from './data/trigger.zod'; // API Protocol (Envelopes, Contracts) export * from './api/contract.zod'; -// AI Protocol (Agent, RAG) +// AI Protocol (Agent, RAG, Model Registry, NLQ) export * from './ai/agent.zod'; +export * from './ai/model-registry.zod'; +export * from './ai/rag-pipeline.zod'; +export * from './ai/nlq.zod'; // UI Protocol (Layout, Navigation, Interaction) export * from './ui/app.zod'; From 2d9f35697fb7594043a9973b23d6085546347c0a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:15:19 +0000 Subject: [PATCH 4/8] feat: Add 4 AI-powered example applications (Support, Analyst, CodeGen, Sales) Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- examples/ai-analyst/README.md | 55 ++++++ examples/ai-analyst/package.json | 14 ++ examples/ai-analyst/src/ai-config.ts | 146 +++++++++++++++ examples/ai-codegen/README.md | 61 ++++++ examples/ai-codegen/package.json | 10 + examples/ai-codegen/src/ai-config.ts | 169 +++++++++++++++++ examples/ai-sales/README.md | 42 +++++ examples/ai-sales/package.json | 10 + examples/ai-sales/src/ai-config.ts | 169 +++++++++++++++++ examples/ai-support/README.md | 145 +++++++++++++++ examples/ai-support/package.json | 19 ++ examples/ai-support/src/ai-config.ts | 267 +++++++++++++++++++++++++++ 12 files changed, 1107 insertions(+) create mode 100644 examples/ai-analyst/README.md create mode 100644 examples/ai-analyst/package.json create mode 100644 examples/ai-analyst/src/ai-config.ts create mode 100644 examples/ai-codegen/README.md create mode 100644 examples/ai-codegen/package.json create mode 100644 examples/ai-codegen/src/ai-config.ts create mode 100644 examples/ai-sales/README.md create mode 100644 examples/ai-sales/package.json create mode 100644 examples/ai-sales/src/ai-config.ts create mode 100644 examples/ai-support/README.md create mode 100644 examples/ai-support/package.json create mode 100644 examples/ai-support/src/ai-config.ts diff --git a/examples/ai-analyst/README.md b/examples/ai-analyst/README.md new file mode 100644 index 0000000..0ee0502 --- /dev/null +++ b/examples/ai-analyst/README.md @@ -0,0 +1,55 @@ +# AI Data Analyst + +> **Natural Language Query system for business intelligence** + +## Overview + +AI-powered data analyst that transforms natural language questions into ObjectQL queries and generates insights. + +## Features + +- **Natural Language Queries**: Ask questions in plain English +- **Auto-generate Dashboards**: Create visualizations from queries +- **Insights Generation**: AI-powered data analysis +- **Query Templates**: Pre-built query patterns + +## Example Queries + +- "What's our total revenue by region for Q1?" +- "Show me the top 10 customers by lifetime value" +- "Compare this month's sales to last month" +- "Which products have declining sales?" + +## NLQ Configuration + +```typescript +export const AnalystNLQConfig: NLQModelConfig = { + modelId: 'gpt-4-turbo', + includeSchema: true, + includeExamples: true, + enableIntentDetection: true, + enableTimeframeDetection: true, + enableFuzzyMatching: true, +}; +``` + +## Agent + +```typescript +export const DataAnalystAgent: Agent = { + name: 'data_analyst_ai', + role: 'Business Intelligence Analyst', + tools: [ + { type: 'query', name: 'execute_sql' }, + { type: 'action', name: 'create_dashboard' }, + { type: 'action', name: 'generate_chart' }, + ], +}; +``` + +## Use Cases + +1. **Executive Dashboards**: Auto-generate KPI dashboards +2. **Ad-hoc Analysis**: Answer business questions instantly +3. **Report Generation**: Create formatted reports from queries +4. **Data Exploration**: Discover patterns and anomalies diff --git a/examples/ai-analyst/package.json b/examples/ai-analyst/package.json new file mode 100644 index 0000000..e03ba12 --- /dev/null +++ b/examples/ai-analyst/package.json @@ -0,0 +1,14 @@ +{ + "name": "@objectstack/example-ai-analyst", + "version": "1.0.0", + "description": "AI-powered data analyst with natural language query capabilities", + "private": true, + "main": "objectstack.config.ts", + "scripts": { + "dev": "tsx watch objectstack.config.ts", + "build": "tsc" + }, + "dependencies": { + "@objectstack/spec": "workspace:*" + } +} diff --git a/examples/ai-analyst/src/ai-config.ts b/examples/ai-analyst/src/ai-config.ts new file mode 100644 index 0000000..85ff549 --- /dev/null +++ b/examples/ai-analyst/src/ai-config.ts @@ -0,0 +1,146 @@ +import type { Agent, NLQModelConfig, QueryTemplate } from '@objectstack/spec'; + +/** + * AI Data Analyst Agent + */ +export const DataAnalystAgent: Agent = { + name: 'data_analyst_ai', + label: 'AI Data Analyst', + role: 'Business Intelligence Analyst', + + instructions: `You are a data analyst helping users understand their business metrics. + +Skills: +- Interpret natural language questions about data +- Generate ObjectQL queries +- Create visualizations +- Provide actionable insights + +Be precise, data-driven, and clear in explanations.`, + + model: { + provider: 'openai', + model: 'gpt-4', + temperature: 0.3, + maxTokens: 4096, + }, + + tools: [ + { + type: 'query', + name: 'execute_objectql', + description: 'Execute ObjectQL queries on data', + }, + { + type: 'action', + name: 'create_dashboard', + description: 'Generate dashboard from metrics', + }, + { + type: 'action', + name: 'generate_chart', + description: 'Create charts and visualizations', + }, + { + type: 'query', + name: 'get_schema', + description: 'Get object schema information', + }, + ], + + access: ['analysts', 'executives', 'managers'], + active: true, +}; + +/** + * NLQ Configuration for Business Intelligence + */ +export const AnalystNLQConfig: NLQModelConfig = { + modelId: 'gpt-4', + systemPrompt: `You are an expert at converting business questions into ObjectQL queries. + +Available objects: account, opportunity, task, product, order +Be precise with field names and support timeframes like "last quarter", "this year".`, + + includeSchema: true, + includeExamples: true, + enableIntentDetection: true, + intentThreshold: 0.75, + enableEntityRecognition: true, + enableFuzzyMatching: true, + fuzzyMatchThreshold: 0.85, + enableTimeframeDetection: true, + defaultTimeframe: 'current_month', + enableCaching: true, + cacheTTL: 3600, +}; + +/** + * Common Query Templates + */ +export const AnalystQueryTemplates: QueryTemplate[] = [ + { + id: 'top-n-by-field', + name: 'top_n_by_field', + label: 'Top N Records by Field', + pattern: 'top {n} {object} by {field}', + variables: [ + { name: 'n', type: 'value', required: true }, + { name: 'object', type: 'object', required: true }, + { name: 'field', type: 'field', required: true }, + ], + astTemplate: { + object: '{object}', + sort: [{ field: '{field}', order: 'desc' }], + limit: '{n}', + }, + category: 'ranking', + examples: [ + 'top 10 accounts by revenue', + 'top 5 products by sales', + ], + }, + + { + id: 'aggregate-by-group', + name: 'aggregate_by_group', + label: 'Aggregate by Group', + pattern: 'total {field} by {group_field}', + variables: [ + { name: 'field', type: 'field', required: true }, + { name: 'group_field', type: 'field', required: true }, + ], + astTemplate: { + fields: [ + '{group_field}', + { function: 'sum', field: '{field}', alias: 'total' }, + ], + groupBy: ['{group_field}'], + }, + category: 'aggregation', + examples: [ + 'total revenue by region', + 'total orders by product', + ], + }, + + { + id: 'time-comparison', + name: 'time_comparison', + label: 'Time Period Comparison', + pattern: 'compare {metric} for {period1} vs {period2}', + variables: [ + { name: 'metric', type: 'field', required: true }, + { name: 'period1', type: 'timeframe', required: true }, + { name: 'period2', type: 'timeframe', required: true }, + ], + astTemplate: { + // Complex comparison logic + }, + category: 'comparison', + examples: [ + 'compare revenue for this month vs last month', + 'compare sales for Q1 vs Q2', + ], + }, +]; diff --git a/examples/ai-codegen/README.md b/examples/ai-codegen/README.md new file mode 100644 index 0000000..9f0bbf7 --- /dev/null +++ b/examples/ai-codegen/README.md @@ -0,0 +1,61 @@ +# AI Code Generator + +> **Generate ObjectStack applications from natural language descriptions** + +## Overview + +AI-powered code generator that creates complete ObjectStack applications from high-level requirements. + +## Features + +- **App Generation**: Create full apps from descriptions +- **Schema Generation**: Generate object definitions +- **Validation**: Ensure generated code follows best practices +- **Test Generation**: Auto-generate tests for objects + +## Example Usage + +**Input**: "Create a project management app with projects, tasks, and team members. Projects should have milestones and budgets. Tasks can be assigned to team members with due dates and priorities." + +**Output**: Complete ObjectStack application with: +- Object definitions (Project, Task, TeamMember, Milestone) +- Relationships (lookup fields) +- Validation rules +- List views and forms +- Navigation structure +- Reports and dashboards + +## Agent Configuration + +```typescript +export const CodeGenAgent: Agent = { + name: 'objectstack_code_generator', + role: 'Senior ObjectStack Developer', + + tools: [ + { type: 'action', name: 'generate_object' }, + { type: 'action', name: 'generate_field' }, + { type: 'action', name: 'generate_view' }, + { type: 'action', name: 'validate_schema' }, + ], + + knowledge: { + topics: ['objectstack_patterns', 'best_practices', 'examples'], + indexes: ['objectstack_docs'], + }, +}; +``` + +## Capabilities + +1. **Object Schema Generation**: Field types, validation, relationships +2. **UI Generation**: Views, forms, dashboards +3. **Logic Generation**: Workflows, validations, triggers +4. **Best Practices**: Follows naming conventions and patterns + +## Success Criteria + +- Generated code passes all validations +- Follows ObjectStack conventions (camelCase, snake_case) +- Includes appropriate indexes and constraints +- Complete with UI configuration diff --git a/examples/ai-codegen/package.json b/examples/ai-codegen/package.json new file mode 100644 index 0000000..ad65765 --- /dev/null +++ b/examples/ai-codegen/package.json @@ -0,0 +1,10 @@ +{ + "name": "@objectstack/example-ai-codegen", + "version": "1.0.0", + "description": "AI code generator - Generate ObjectStack apps from natural language", + "private": true, + "main": "objectstack.config.ts", + "dependencies": { + "@objectstack/spec": "workspace:*" + } +} diff --git a/examples/ai-codegen/src/ai-config.ts b/examples/ai-codegen/src/ai-config.ts new file mode 100644 index 0000000..77e95c2 --- /dev/null +++ b/examples/ai-codegen/src/ai-config.ts @@ -0,0 +1,169 @@ +import type { Agent, ModelRegistry, PromptTemplate, RAGPipelineConfig } from '@objectstack/spec'; + +/** + * ObjectStack Code Generator Agent + */ +export const CodeGenAgent: Agent = { + name: 'objectstack_code_generator', + label: 'ObjectStack Code Generator', + role: 'Senior ObjectStack Developer', + + instructions: `You are an expert ObjectStack developer who generates high-quality applications. + +Rules: +1. Follow ObjectStack naming conventions (camelCase for props, snake_case for names) +2. Generate complete, production-ready code +3. Include validation rules and indexes +4. Create appropriate views and forms +5. Follow best practices from the knowledge base + +Always validate generated code before returning.`, + + model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.3, + maxTokens: 8192, + }, + + tools: [ + { + type: 'action', + name: 'generate_object', + description: 'Generate ObjectStack object definition', + }, + { + type: 'action', + name: 'generate_field', + description: 'Generate field definition', + }, + { + type: 'action', + name: 'generate_view', + description: 'Generate view configuration', + }, + { + type: 'action', + name: 'validate_schema', + description: 'Validate generated schema', + }, + { + type: 'vector_search', + name: 'search_examples', + description: 'Search example applications', + }, + ], + + knowledge: { + topics: [ + 'objectstack_protocol', + 'best_practices', + 'code_examples', + 'design_patterns', + ], + indexes: ['objectstack_knowledge'], + }, + + active: true, +}; + +/** + * Code Generation Model Registry + */ +export const CodeGenModelRegistry: ModelRegistry = { + name: 'code_generation_registry', + + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + codeGeneration: true, + reasoning: true, + }, + limits: { + maxTokens: 8192, + contextWindow: 128000, + }, + recommendedFor: ['code_generation', 'complex_reasoning'], + }, + status: 'active', + priority: 10, + }, + }, + + promptTemplates: { + object_generator: { + id: 'object-gen-v1', + name: 'object_generator', + label: 'Object Generator', + system: `You are an expert at generating ObjectStack object definitions. + +Generate valid TypeScript code following ObjectStack Protocol. +Use camelCase for configuration properties, snake_case for name identifiers.`, + user: `Generate an ObjectStack object for: {{description}} + +Requirements: +{{requirements}} + +Include: +- Field definitions with proper types +- Validation rules if needed +- Indexes for performance +- Enable appropriate features`, + variables: [ + { name: 'description', type: 'string', required: true }, + { name: 'requirements', type: 'string', required: false }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.3, + category: 'code_generation', + }, + }, + + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, +}; + +/** + * RAG for ObjectStack Documentation + */ +export const ObjectStackDocsRAG: RAGPipelineConfig = { + name: 'objectstack_documentation', + label: 'ObjectStack Documentation RAG', + description: 'RAG pipeline for ObjectStack protocol docs and examples', + + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + }, + + vectorStore: { + provider: 'pinecone', + indexName: 'objectstack-docs', + dimensions: 3072, + metric: 'cosine', + }, + + chunking: { + type: 'markdown', + maxChunkSize: 1500, + respectHeaders: true, + respectCodeBlocks: true, + }, + + retrieval: { + type: 'similarity', + topK: 5, + scoreThreshold: 0.7, + }, + + maxContextTokens: 8000, + enableCache: true, + cacheTTL: 7200, +}; diff --git a/examples/ai-sales/README.md b/examples/ai-sales/README.md new file mode 100644 index 0000000..d78ec96 --- /dev/null +++ b/examples/ai-sales/README.md @@ -0,0 +1,42 @@ +# AI Sales Assistant + +> **Intelligent sales automation and insights** + +## Overview + +AI-powered sales assistant that qualifies leads, personalizes outreach, and provides opportunity insights. + +## Features + +- **Lead Qualification**: Automatically score and qualify leads +- **Email Personalization**: Generate personalized outreach emails +- **Opportunity Insights**: Analyze deals and suggest next steps +- **Competitive Intelligence**: Research competitors + +## Agent + +```typescript +export const SalesAgent: Agent = { + name: 'sales_assistant_ai', + role: 'Sales Development Representative', + + tools: [ + { type: 'query', name: 'get_account_info' }, + { type: 'action', name: 'update_opportunity' }, + { type: 'action', name: 'send_email' }, + { type: 'flow', name: 'create_follow_up' }, + ], + + knowledge: { + topics: ['sales_playbooks', 'product_features', 'case_studies'], + indexes: ['sales_intelligence'], + }, +}; +``` + +## Use Cases + +1. **Lead Scoring**: AI analyzes leads and assigns scores +2. **Email Campaigns**: Generate personalized email sequences +3. **Deal Analysis**: Predict win probability and suggest actions +4. **Competitive Research**: Analyze competitor information diff --git a/examples/ai-sales/package.json b/examples/ai-sales/package.json new file mode 100644 index 0000000..b7e9cb9 --- /dev/null +++ b/examples/ai-sales/package.json @@ -0,0 +1,10 @@ +{ + "name": "@objectstack/example-ai-sales", + "version": "1.0.0", + "description": "AI-powered sales assistant with intelligent automation", + "private": true, + "main": "objectstack.config.ts", + "dependencies": { + "@objectstack/spec": "workspace:*" + } +} diff --git a/examples/ai-sales/src/ai-config.ts b/examples/ai-sales/src/ai-config.ts new file mode 100644 index 0000000..c447eb7 --- /dev/null +++ b/examples/ai-sales/src/ai-config.ts @@ -0,0 +1,169 @@ +import type { Agent, ModelRegistry, RAGPipelineConfig } from '@objectstack/spec'; + +/** + * AI Sales Assistant Agent + */ +export const SalesAgent: Agent = { + name: 'sales_assistant_ai', + label: 'AI Sales Assistant', + role: 'Sales Development Representative', + + instructions: `You are a sales assistant helping SDRs close deals. + +Core capabilities: +- Research accounts and contacts +- Draft personalized outreach emails +- Update opportunity information +- Provide competitive intelligence +- Schedule follow-ups + +Be persuasive but honest. Focus on value creation.`, + + model: { + provider: 'anthropic', + model: 'claude-3-sonnet-20240229', + temperature: 0.8, + }, + + tools: [ + { + type: 'query', + name: 'get_account_info', + description: 'Retrieve account and contact details', + }, + { + type: 'action', + name: 'update_opportunity', + description: 'Update opportunity fields and stage', + }, + { + type: 'action', + name: 'send_email', + description: 'Send personalized email via template', + }, + { + type: 'flow', + name: 'create_follow_up_task', + description: 'Schedule follow-up activity', + }, + { + type: 'vector_search', + name: 'search_case_studies', + description: 'Find relevant customer success stories', + }, + ], + + knowledge: { + topics: ['sales_playbooks', 'product_features', 'case_studies', 'competitor_analysis'], + indexes: ['sales_intelligence'], + }, + + access: ['sales_team'], + active: true, +}; + +/** + * Sales Model Registry + */ +export const SalesModelRegistry: ModelRegistry = { + name: 'sales_ai_registry', + + models: { + 'claude-3-sonnet': { + model: { + id: 'claude-3-sonnet', + name: 'Claude 3 Sonnet', + version: 'claude-3-sonnet-20240229', + provider: 'anthropic', + capabilities: { + textGeneration: true, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 200000, + }, + pricing: { + inputCostPer1kTokens: 0.003, + outputCostPer1kTokens: 0.015, + }, + recommendedFor: ['creative_writing', 'personalization'], + }, + status: 'active', + priority: 10, + }, + }, + + promptTemplates: { + personalized_email: { + id: 'email-v1', + name: 'personalized_email', + label: 'Personalized Sales Email', + system: 'You are an expert sales writer. Create compelling, personalized emails.', + user: `Write a personalized email to: +Company: {{company_name}} +Contact: {{contact_name}} +Title: {{contact_title}} +Industry: {{industry}} + +Objective: {{objective}} +Value Proposition: {{value_prop}} + +Tone: Professional but friendly. Max 150 words.`, + variables: [ + { name: 'company_name', type: 'string', required: true }, + { name: 'contact_name', type: 'string', required: true }, + { name: 'contact_title', type: 'string', required: false }, + { name: 'industry', type: 'string', required: false }, + { name: 'objective', type: 'string', required: true }, + { name: 'value_prop', type: 'string', required: true }, + ], + modelId: 'claude-3-sonnet', + temperature: 0.8, + category: 'sales_outreach', + }, + }, + + defaultModel: 'claude-3-sonnet', + enableAutoFallback: true, +}; + +/** + * Sales Intelligence RAG + */ +export const SalesIntelligenceRAG: RAGPipelineConfig = { + name: 'sales_intelligence', + label: 'Sales Intelligence', + description: 'RAG pipeline for sales playbooks, case studies, and competitive intel', + + embedding: { + provider: 'openai', + model: 'text-embedding-3-small', + dimensions: 1536, + }, + + vectorStore: { + provider: 'weaviate', + indexName: 'SalesIntelligence', + dimensions: 1536, + metric: 'cosine', + }, + + chunking: { + type: 'recursive', + separators: ['\n\n', '\n', '. ', ' '], + chunkSize: 800, + chunkOverlap: 100, + }, + + retrieval: { + type: 'hybrid', + topK: 8, + vectorWeight: 0.7, + keywordWeight: 0.3, + }, + + maxContextTokens: 4000, + enableCache: true, + cacheTTL: 3600, +}; diff --git a/examples/ai-support/README.md b/examples/ai-support/README.md new file mode 100644 index 0000000..0bf356e --- /dev/null +++ b/examples/ai-support/README.md @@ -0,0 +1,145 @@ +# AI Support Assistant + +> **RAG-powered customer support system demonstrating ObjectStack AI protocols** + +## Overview + +This example demonstrates how to build an intelligent customer support system using ObjectStack's AI protocols: + +- **RAG Pipeline**: Knowledge base powered by vector search +- **AI Agent**: Intelligent support agent with function calling +- **Model Registry**: Centralized LLM configuration with fallback support +- **Natural Language Queries**: Business users can query tickets using natural language + +## Features + +### 1. RAG-Powered Knowledge Base +- Vector search across documentation +- Semantic chunking of markdown content +- MMR retrieval for diverse results +- Cohere reranking for accuracy + +### 2. Intelligent Support Agent +- Answer customer questions using RAG +- Create and update support tickets +- Search existing tickets for similar issues +- Escalate to human agents when needed +- Collect customer satisfaction feedback + +### 3. Natural Language Ticketing +- "Show me all high priority tickets" +- "What tickets are assigned to me?" +- "How many open tickets from last week?" + +## Architecture + +``` +ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” +│ Customer Interface │ +│ (Chat, Email, Web Portal) │ +ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ + │ +ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” +│ AI Support Agent │ +│ (GPT-4 Turbo with function calling) │ +ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ + │ + ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” + │ │ │ +ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā” +│ RAG Pipeline │ │ Actions │ │ ObjectQL │ +│ (Pinecone) │ │ (CRUD) │ │ (Query) │ +ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ +``` + +## Configuration Files + +- `src/ai-config.ts` - AI agent, model registry, and RAG pipeline +- `src/domains/ticket.object.ts` - Support ticket data model +- `objectstack.config.ts` - Application configuration + +## Quick Start + +```bash +# Install dependencies +pnpm install + +# Start development server +pnpm dev +``` + +## AI Configuration + +### Agent Configuration +```typescript +export const SupportAgent: Agent = { + name: 'customer_support_ai', + label: 'AI Support Agent', + role: 'Senior Customer Support Specialist', + + tools: [ + { type: 'action', name: 'create_support_ticket' }, + { type: 'vector_search', name: 'kb_search' }, + { type: 'query', name: 'search_tickets' }, + ], + + knowledge: { + topics: ['product_documentation', 'faq', 'troubleshooting'], + indexes: ['support_kb_v2'], + }, +}; +``` + +### RAG Pipeline +```typescript +export const KnowledgeBaseRAG: RAGPipelineConfig = { + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + }, + + vectorStore: { + provider: 'pinecone', + indexName: 'support-kb-prod', + }, + + retrieval: { + type: 'mmr', + topK: 5, + lambda: 0.7, + }, +}; +``` + +## Example Interactions + +### Customer Query +**Customer**: "My API calls are failing with a 401 error" + +**AI Agent**: +1. Searches knowledge base for authentication errors +2. Finds relevant documentation +3. Provides step-by-step troubleshooting +4. If unresolved, creates a ticket and escalates + +### Natural Language Ticket Query +**Support Manager**: "Show me all critical tickets from the last 24 hours" + +**System**: +1. Parses natural language to ObjectQL +2. Executes query: `ticket.filter(priority='critical', created_date>yesterday)` +3. Returns formatted results with summaries + +## Success Metrics + +- **Response Time**: < 2s for RAG queries +- **Accuracy**: 90%+ customer satisfaction +- **Automation**: 70% of tickets handled without human intervention +- **Knowledge Coverage**: 95% of queries have relevant KB articles + +## Related Examples + +- [AI Data Analyst](../ai-analyst) - NLQ for business intelligence +- [AI Code Generator](../ai-codegen) - Generate ObjectStack apps from descriptions +- [AI Sales Assistant](../ai-sales) - Intelligent sales automation diff --git a/examples/ai-support/package.json b/examples/ai-support/package.json new file mode 100644 index 0000000..119f6d9 --- /dev/null +++ b/examples/ai-support/package.json @@ -0,0 +1,19 @@ +{ + "name": "@objectstack/example-ai-support", + "version": "1.0.0", + "description": "AI-powered customer support system with RAG knowledge base", + "private": true, + "main": "objectstack.config.ts", + "scripts": { + "dev": "tsx watch objectstack.config.ts", + "build": "tsc" + }, + "dependencies": { + "@objectstack/spec": "workspace:*" + }, + "devDependencies": { + "@types/node": "^20.10.0", + "tsx": "^4.21.0", + "typescript": "^5.3.0" + } +} diff --git a/examples/ai-support/src/ai-config.ts b/examples/ai-support/src/ai-config.ts new file mode 100644 index 0000000..5c281fb --- /dev/null +++ b/examples/ai-support/src/ai-config.ts @@ -0,0 +1,267 @@ +import type { + Agent, + ModelRegistry, + RAGPipelineConfig, + FieldSynonymConfig, +} from '@objectstack/spec'; + +/** + * AI Support Assistant - Agent Configuration + */ +export const SupportAgent: Agent = { + name: 'customer_support_ai', + label: 'AI Support Agent', + avatar: '/avatars/support-bot.png', + role: 'Senior Customer Support Specialist', + + instructions: `You are an experienced customer support agent for ObjectStack. + +Your responsibilities: +- Answer customer questions professionally and accurately +- Search the knowledge base for solutions +- Create support tickets when needed +- Escalate complex issues to human agents +- Track customer satisfaction + +Always be polite, empathetic, and solution-oriented. If you don't know something, say so and offer to escalate.`, + + model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.7, + maxTokens: 2048, + }, + + tools: [ + { + type: 'action', + name: 'create_support_ticket', + description: 'Create a new support ticket for the customer', + }, + { + type: 'action', + name: 'escalate_to_human', + description: 'Transfer conversation to a human agent', + }, + { + type: 'query', + name: 'search_tickets', + description: 'Search existing support tickets for similar issues', + }, + { + type: 'vector_search', + name: 'kb_search', + description: 'Search the knowledge base for relevant documentation', + }, + { + type: 'action', + name: 'update_ticket_status', + description: 'Update the status of a support ticket', + }, + { + type: 'flow', + name: 'collect_customer_feedback', + description: 'Collect customer satisfaction feedback', + }, + ], + + knowledge: { + topics: [ + 'product_documentation', + 'troubleshooting_guides', + 'faq', + 'api_reference', + 'best_practices', + 'release_notes', + ], + indexes: ['support_kb_v2'], + }, + + access: ['support_team', 'customers'], + active: true, +}; + +/** + * Model Registry for AI Support + */ +export const SupportModelRegistry: ModelRegistry = { + name: 'ai_support_registry', + + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + functionCalling: true, + codeGeneration: false, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 128000, + rateLimit: { + requestsPerMinute: 100, + }, + }, + pricing: { + inputCostPer1kTokens: 0.01, + outputCostPer1kTokens: 0.03, + }, + tags: ['chat', 'support'], + }, + status: 'active', + priority: 10, + fallbackModels: ['gpt-3.5-turbo'], + healthCheck: { + enabled: true, + intervalSeconds: 300, + status: 'healthy', + }, + }, + + 'text-embedding-3-large': { + model: { + id: 'text-embedding-3-large', + name: 'Text Embedding 3 Large', + version: 'text-embedding-3-large', + provider: 'openai', + capabilities: { + textGeneration: false, + textEmbedding: true, + }, + limits: { + maxTokens: 8191, + contextWindow: 8191, + }, + pricing: { + embeddingCostPer1kTokens: 0.00013, + }, + tags: ['embedding', 'rag'], + }, + status: 'active', + priority: 10, + }, + }, + + promptTemplates: { + support_response: { + id: 'support-response-v1', + name: 'support_response', + label: 'Support Response Template', + system: 'You are a helpful customer support agent. Be empathetic and solution-oriented.', + user: `Customer: {{customer_name}} +Question: {{question}} +Knowledge Base Context: {{kb_context}} + +Provide a helpful, professional response.`, + variables: [ + { name: 'customer_name', type: 'string', required: true }, + { name: 'question', type: 'string', required: true }, + { name: 'kb_context', type: 'string', required: false }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.7, + category: 'support', + }, + }, + + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, +}; + +/** + * RAG Pipeline for Knowledge Base + */ +export const KnowledgeBaseRAG: RAGPipelineConfig = { + name: 'support_knowledge_base', + label: 'Customer Support Knowledge Base', + description: 'RAG pipeline for customer support documentation, FAQs, and troubleshooting guides', + + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + batchSize: 100, + }, + + vectorStore: { + provider: 'pinecone', + indexName: 'support-kb-prod', + namespace: 'v2', + dimensions: 3072, + metric: 'cosine', + batchSize: 100, + }, + + chunking: { + type: 'markdown', + maxChunkSize: 1000, + respectHeaders: true, + respectCodeBlocks: true, + }, + + retrieval: { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.7, + }, + + reranking: { + enabled: true, + model: 'rerank-english-v3.0', + provider: 'cohere', + topK: 3, + }, + + loaders: [ + { + type: 'directory', + source: '/knowledge-base/docs', + fileTypes: ['.md', '.txt', '.pdf'], + recursive: true, + maxFileSize: 5242880, // 5MB + excludePatterns: ['**/archive/**', '**/drafts/**'], + extractTables: true, + }, + ], + + maxContextTokens: 6000, + contextWindow: 128000, + + metadataFilters: { + status: 'published', + language: 'en', + }, + + enableCache: true, + cacheTTL: 3600, +}; + +/** + * Field Synonyms for Natural Language Queries + */ +export const SupportFieldSynonyms: FieldSynonymConfig[] = [ + { + object: 'support_ticket', + field: 'status', + synonyms: ['state', 'current status', 'ticket status', 'situation'], + examples: [ + 'show open tickets', + 'what is the current status of my ticket', + ], + }, + { + object: 'support_ticket', + field: 'priority', + synonyms: ['urgency', 'importance', 'severity'], + examples: [ + 'show high priority tickets', + 'urgent cases', + ], + }, +]; From 3cc71a3a152995bf7c53530061d94bb631f5067e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:19:57 +0000 Subject: [PATCH 5/8] feat: Add comprehensive AI integration guide and address code review feedback Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- docs/AI_INTEGRATION_GUIDE.md | 804 +++++++++++++++++++++++ packages/spec/src/ai/rag-pipeline.zod.ts | 10 +- 2 files changed, 812 insertions(+), 2 deletions(-) create mode 100644 docs/AI_INTEGRATION_GUIDE.md diff --git a/docs/AI_INTEGRATION_GUIDE.md b/docs/AI_INTEGRATION_GUIDE.md new file mode 100644 index 0000000..aa8f3a6 --- /dev/null +++ b/docs/AI_INTEGRATION_GUIDE.md @@ -0,0 +1,804 @@ +# AI Integration Guide + +> **Complete guide to building AI-powered ObjectStack applications** + +## Table of Contents + +1. [Introduction](#introduction) +2. [AI Protocols Overview](#ai-protocols-overview) +3. [Getting Started](#getting-started) +4. [Building AI Agents](#building-ai-agents) +5. [Implementing RAG](#implementing-rag) +6. [Natural Language Queries](#natural-language-queries) +7. [Model Registry](#model-registry) +8. [Production Best Practices](#production-best-practices) +9. [Example Applications](#example-applications) + +--- + +## Introduction + +ObjectStack provides a comprehensive AI protocol suite enabling you to build intelligent, context-aware applications. This guide covers all AI capabilities from RAG pipelines to natural language query processing. + +### What You Can Build + +- **Intelligent Assistants**: Context-aware chatbots with function calling +- **Natural Language Interfaces**: Query data using plain English +- **Code Generators**: Generate ObjectStack apps from descriptions +- **Smart Automation**: AI-powered workflows and decision making + +--- + +## AI Protocols Overview + +ObjectStack includes four core AI protocols: + +### 1. Agent Protocol (`@objectstack/spec/ai/agent`) +Define autonomous AI agents with: +- Model configuration +- Function calling (tools) +- Knowledge base access (RAG) +- Access control + +### 2. Model Registry Protocol (`@objectstack/spec/ai/model-registry`) +Centralized LLM management: +- Model configurations +- Prompt templates +- Fallback handling +- Health monitoring + +### 3. RAG Pipeline Protocol (`@objectstack/spec/ai/rag-pipeline`) +Retrieval-Augmented Generation: +- Vector store configuration +- Embedding models +- Chunking strategies +- Retrieval methods (similarity, MMR, hybrid) + +### 4. Natural Language Query Protocol (`@objectstack/spec/ai/nlq`) +Transform natural language to ObjectQL: +- Intent detection +- Entity recognition +- Timeframe parsing +- Field mapping + +--- + +## Getting Started + +### Installation + +```bash +npm install @objectstack/spec +``` + +### Basic Agent + +```typescript +import { Agent } from '@objectstack/spec'; + +const myAgent: Agent = { + name: 'my_assistant', + label: 'My AI Assistant', + role: 'Customer Support Specialist', + instructions: 'You are a helpful assistant.', + + model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.7, + }, + + active: true, +}; +``` + +--- + +## Building AI Agents + +### Agent Components + +#### 1. Identity & Role +```typescript +const agent: Agent = { + name: 'support_agent', // snake_case identifier + label: 'Support Agent', // Display name + avatar: '/avatars/bot.png', // Optional avatar + role: 'Customer Support', // Agent persona +}; +``` + +#### 2. Instructions (System Prompt) +```typescript +instructions: `You are an experienced customer support agent. + +Your responsibilities: +- Answer questions professionally +- Create support tickets when needed +- Escalate complex issues + +Always be polite and solution-oriented.` +``` + +#### 3. Model Configuration +```typescript +model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.7, // Creativity (0-2) + maxTokens: 2048, // Response length + topP: 0.9, // Nucleus sampling +} +``` + +#### 4. Tools (Function Calling) +```typescript +tools: [ + { + type: 'action', + name: 'create_ticket', + description: 'Create a new support ticket', + }, + { + type: 'query', + name: 'search_tickets', + description: 'Search existing tickets', + }, + { + type: 'vector_search', + name: 'kb_search', + description: 'Search knowledge base', + }, + { + type: 'flow', + name: 'escalate_to_human', + description: 'Transfer to human agent', + }, +] +``` + +#### 5. Knowledge Base (RAG) +```typescript +knowledge: { + topics: ['product_docs', 'faq', 'troubleshooting'], + indexes: ['support_kb_v2'], +} +``` + +#### 6. Access Control +```typescript +access: ['support_team', 'customers'], +active: true, +``` + +### Advanced Agent Example + +```typescript +import { Agent } from '@objectstack/spec'; + +export const DataAnalystAgent: Agent = { + name: 'data_analyst_ai', + label: 'AI Data Analyst', + avatar: '/avatars/analyst.png', + role: 'Business Intelligence Analyst', + + instructions: `You are a data analyst helping users understand business metrics. + +Skills: +- Interpret natural language questions about data +- Generate ObjectQL queries +- Create visualizations +- Provide actionable insights + +Be precise, data-driven, and clear.`, + + model: { + provider: 'openai', + model: 'gpt-4', + temperature: 0.3, // Lower for precision + maxTokens: 4096, + }, + + tools: [ + { + type: 'query', + name: 'execute_objectql', + description: 'Execute ObjectQL queries on data', + }, + { + type: 'action', + name: 'create_dashboard', + description: 'Generate dashboard from metrics', + }, + { + type: 'action', + name: 'generate_chart', + description: 'Create visualizations', + }, + ], + + knowledge: { + topics: ['sql_guides', 'metrics_definitions'], + indexes: ['analytics_kb'], + }, + + access: ['analysts', 'executives', 'managers'], + active: true, +}; +``` + +--- + +## Implementing RAG + +### Why RAG? + +RAG (Retrieval-Augmented Generation) enables AI to: +- Access up-to-date information +- Reduce hallucinations +- Provide source citations +- Scale beyond context windows + +### RAG Pipeline Configuration + +```typescript +import { RAGPipelineConfig } from '@objectstack/spec'; + +const myRAG: RAGPipelineConfig = { + name: 'knowledge_base', + label: 'Knowledge Base RAG', + description: 'RAG for product documentation', + + // 1. Embedding Model + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + batchSize: 100, + }, + + // 2. Vector Store + vectorStore: { + provider: 'pinecone', + indexName: 'kb-prod', + namespace: 'v2', + dimensions: 3072, + metric: 'cosine', + }, + + // 3. Chunking Strategy + chunking: { + type: 'markdown', + maxChunkSize: 1000, + respectHeaders: true, + respectCodeBlocks: true, + }, + + // 4. Retrieval Method + retrieval: { + type: 'mmr', // Maximal Marginal Relevance + topK: 5, + fetchK: 20, + lambda: 0.7, // Balance relevance vs diversity + }, + + // 5. Optional Reranking + reranking: { + enabled: true, + model: 'rerank-english-v3.0', + provider: 'cohere', + topK: 3, + }, + + // 6. Document Loaders + loaders: [ + { + type: 'directory', + source: '/docs', + fileTypes: ['.md', '.txt', '.pdf'], + recursive: true, + }, + ], + + maxContextTokens: 6000, + enableCache: true, + cacheTTL: 3600, +}; +``` + +### Chunking Strategies + +#### Fixed Size +```typescript +chunking: { + type: 'fixed', + chunkSize: 512, + chunkOverlap: 50, + unit: 'tokens', +} +``` + +#### Semantic Chunking +```typescript +chunking: { + type: 'semantic', + minChunkSize: 100, + maxChunkSize: 1000, +} +``` + +#### Recursive Text Splitting +```typescript +chunking: { + type: 'recursive', + separators: ['\n\n', '\n', '. ', ' '], + chunkSize: 1000, + chunkOverlap: 100, +} +``` + +#### Markdown-Aware +```typescript +chunking: { + type: 'markdown', + maxChunkSize: 1500, + respectHeaders: true, + respectCodeBlocks: true, +} +``` + +### Retrieval Methods + +#### Similarity Search +```typescript +retrieval: { + type: 'similarity', + topK: 5, + scoreThreshold: 0.7, +} +``` + +#### MMR (Diverse Results) +```typescript +retrieval: { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.5, // 0=diverse, 1=relevant +} +``` + +#### Hybrid (Vector + Keyword) +```typescript +retrieval: { + type: 'hybrid', + topK: 10, + vectorWeight: 0.7, + keywordWeight: 0.3, +} +``` + +### Querying RAG + +```typescript +import { RAGQueryRequest } from '@objectstack/spec'; + +const request: RAGQueryRequest = { + query: 'How do I configure authentication?', + pipelineName: 'knowledge_base', + topK: 5, + metadataFilters: { + category: 'security', + }, + includeMetadata: true, + includeSources: true, + executeQuery: false, // Just retrieve, don't generate +}; +``` + +--- + +## Natural Language Queries + +### NLQ Configuration + +```typescript +import { NLQModelConfig } from '@objectstack/spec'; + +const nlqConfig: NLQModelConfig = { + modelId: 'gpt-4-turbo', + + // Prompt Engineering + systemPrompt: `Convert natural language to ObjectQL. + Available objects: account, opportunity, task`, + + includeSchema: true, + includeExamples: true, + + // Features + enableIntentDetection: true, + enableEntityRecognition: true, + enableFuzzyMatching: true, + enableTimeframeDetection: true, + + // Caching + enableCaching: true, + cacheTTL: 3600, +}; +``` + +### Field Synonyms + +Help NLQ understand natural variations: + +```typescript +import { FieldSynonymConfig } from '@objectstack/spec'; + +const synonyms: FieldSynonymConfig[] = [ + { + object: 'account', + field: 'name', + synonyms: [ + 'customer name', + 'company name', + 'organization name', + 'account name', + ], + examples: [ + 'show accounts by customer name', + 'find companies with name containing Acme', + ], + }, + { + object: 'opportunity', + field: 'amount', + synonyms: [ + 'value', + 'deal size', + 'revenue', + 'worth', + ], + }, +]; +``` + +### Query Templates + +Pre-built patterns for common queries: + +```typescript +import { QueryTemplate } from '@objectstack/spec'; + +const topNTemplate: QueryTemplate = { + id: 'top-n-by-field', + name: 'top_n_by_field', + label: 'Top N Records', + + pattern: 'top {n} {object} by {field}', + + variables: [ + { name: 'n', type: 'value', required: true }, + { name: 'object', type: 'object', required: true }, + { name: 'field', type: 'field', required: true }, + ], + + astTemplate: { + object: '{object}', + sort: [{ field: '{field}', order: 'desc' }], + limit: '{n}', + }, + + examples: [ + 'top 10 accounts by revenue', + 'top 5 opportunities by amount', + ], +}; +``` + +### Processing NLQ Requests + +```typescript +import { NLQRequest, NLQResponse } from '@objectstack/spec'; + +const request: NLQRequest = { + query: 'show me all high priority tickets from last week', + + context: { + userId: 'user-123', + currentObject: 'ticket', + defaultLimit: 100, + }, + + includeAlternatives: true, + maxAlternatives: 3, + minConfidence: 0.7, + + executeQuery: true, + maxResults: 50, +}; + +// Response includes: +// - Parsed intent, entities, timeframe +// - Generated ObjectQL AST +// - Optional: Query results +// - Confidence scores +// - Alternative interpretations +``` + +--- + +## Model Registry + +### Registry Configuration + +```typescript +import { ModelRegistry } from '@objectstack/spec'; + +const registry: ModelRegistry = { + name: 'production_registry', + + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + + capabilities: { + textGeneration: true, + functionCalling: true, + reasoning: true, + }, + + limits: { + maxTokens: 4096, + contextWindow: 128000, + rateLimit: { + requestsPerMinute: 100, + }, + }, + + pricing: { + inputCostPer1kTokens: 0.01, + outputCostPer1kTokens: 0.03, + }, + }, + + status: 'active', + priority: 10, + fallbackModels: ['gpt-3.5-turbo'], + + healthCheck: { + enabled: true, + intervalSeconds: 300, + status: 'healthy', + }, + }, + }, + + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, +}; +``` + +### Prompt Templates + +Reusable prompts with variables: + +```typescript +promptTemplates: { + support_response: { + id: 'support-v1', + name: 'support_response', + label: 'Support Response', + + system: 'You are a helpful support agent.', + user: `Customer: {{customer_name}} +Question: {{question}} +Context: {{context}}`, + + variables: [ + { name: 'customer_name', type: 'string', required: true }, + { name: 'question', type: 'string', required: true }, + { name: 'context', type: 'string', required: false }, + ], + + modelId: 'gpt-4-turbo', + temperature: 0.7, + maxTokens: 2048, + + examples: [ + { + input: { + customer_name: 'John Doe', + question: 'How do I reset my password?', + }, + output: 'To reset your password...', + }, + ], + }, +} +``` + +--- + +## Production Best Practices + +### 1. Model Selection + +- **Reasoning tasks**: GPT-4, Claude 3 Opus +- **Simple tasks**: GPT-3.5, Claude 3 Haiku +- **Embeddings**: text-embedding-3-large +- **Creative writing**: Claude 3 Sonnet + +### 2. Cost Optimization + +- Use smaller models for simple tasks +- Enable caching for repeated queries +- Batch embedding requests +- Set appropriate token limits + +### 3. Error Handling + +```typescript +{ + status: 'active', + priority: 10, + fallbackModels: ['backup-model'], + healthCheck: { + enabled: true, + intervalSeconds: 300, + }, +} +``` + +### 4. Security + +- Store API keys in environment variables +- Use access control on agents +- Validate user inputs +- Implement rate limiting +- Monitor for abuse + +### 5. Monitoring + +Track: +- Response times +- Token usage +- Error rates +- User satisfaction +- Cache hit rates + +### 6. Testing + +```typescript +import { NLQTrainingExample } from '@objectstack/spec'; + +const trainingExamples: NLQTrainingExample[] = [ + { + query: 'show all accounts created last month', + expectedIntent: 'select', + expectedObject: 'account', + expectedAST: { + object: 'account', + filters: [['created_date', '>=', '2023-12-01']], + }, + }, +]; +``` + +--- + +## Example Applications + +### 1. AI Support Assistant +[View Example](../examples/ai-support) + +**Features:** +- RAG knowledge base +- Ticket management +- Escalation workflows +- Customer satisfaction tracking + +**Architecture:** +``` +Customer → GPT-4 Agent → RAG (Pinecone) → Actions → ObjectQL +``` + +### 2. AI Data Analyst +[View Example](../examples/ai-analyst) + +**Features:** +- Natural language queries +- Auto-generate dashboards +- Time-based analysis +- Query templates + +### 3. AI Code Generator +[View Example](../examples/ai-codegen) + +**Features:** +- Generate ObjectStack apps +- Schema validation +- Best practices enforcement +- RAG for documentation + +### 4. AI Sales Assistant +[View Example](../examples/ai-sales) + +**Features:** +- Lead qualification +- Email personalization +- Competitive intelligence +- Deal insights + +--- + +## FAQ + +### When should I use RAG vs fine-tuning? + +**Use RAG when:** +- Information changes frequently +- You need source citations +- Data is too large for context window +- Privacy/compliance requirements + +**Use fine-tuning when:** +- Teaching specific writing style +- Domain-specific terminology +- Consistent behavior needed +- Cost optimization for high volume + +### How do I handle low confidence queries? + +```typescript +if (response.parseResult.confidence < 0.7) { + if (response.needsClarification) { + // Ask user for clarification + showSuggestions(response.suggestions); + } else { + // Show alternative interpretations + showAlternatives(response.parseResult.alternatives); + } +} +``` + +### What vector database should I use? + +- **Pinecone**: Managed, easy to use +- **Weaviate**: Open source, flexible +- **Qdrant**: High performance, Rust-based +- **pgvector**: PostgreSQL extension +- **Chroma**: Local development + +### How do I optimize RAG performance? + +1. Use appropriate chunk sizes (500-1000 tokens) +2. Enable reranking for accuracy +3. Use MMR for diverse results +4. Cache frequently accessed chunks +5. Filter by metadata when possible +6. Monitor retrieval metrics + +--- + +## Resources + +- [ObjectStack Documentation](https://docs.objectstack.ai) +- [AI Protocol Reference](../packages/spec/src/ai) +- [Example Applications](../examples) +- [Discord Community](https://discord.gg/objectstack) + +--- + +## Next Steps + +1. Start with a simple agent +2. Add RAG for your knowledge base +3. Implement natural language queries +4. Deploy to production +5. Monitor and optimize + +Happy building! šŸš€ diff --git a/packages/spec/src/ai/rag-pipeline.zod.ts b/packages/spec/src/ai/rag-pipeline.zod.ts index 790fa4f..e8cfea0 100644 --- a/packages/spec/src/ai/rag-pipeline.zod.ts +++ b/packages/spec/src/ai/rag-pipeline.zod.ts @@ -129,7 +129,7 @@ export const RerankingConfigSchema = z.object({ enabled: z.boolean().default(false), model: z.string().optional().describe('Reranking model name'), provider: z.enum(['cohere', 'huggingface', 'custom']).optional(), - topK: z.number().int().positive().optional().describe('Final number of results after reranking'), + topK: z.number().int().positive().default(3).describe('Final number of results after reranking'), }); /** @@ -204,11 +204,17 @@ export const RAGPipelineConfigSchema = z.object({ contextWindow: z.number().int().positive().optional().describe('LLM context window size'), /** Metadata Filtering */ - metadataFilters: z.record(z.any()).optional().describe('Filters for retrieval'), + metadataFilters: z.record(z.union([ + z.string(), + z.number(), + z.boolean(), + z.array(z.union([z.string(), z.number()])), + ])).optional().describe('Filters for retrieval (e.g., {category: "docs", status: "published"})'), /** Caching */ enableCache: z.boolean().default(true), cacheTTL: z.number().int().positive().default(3600).describe('Cache TTL in seconds'), + cacheInvalidationStrategy: z.enum(['time_based', 'manual', 'on_update']).default('time_based').optional(), }); /** From cdf4bdc0fe7ae8ac8dc8df32ef50be23dbe51d29 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:08:41 +0000 Subject: [PATCH 6/8] fix: Resolve naming conflict and update lockfile for CI compatibility Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- .../docs/references/ai/ChunkingStrategy.mdx | 5 + content/docs/references/ai/DocumentChunk.mdx | 15 + .../references/ai/DocumentLoaderConfig.mdx | 18 + .../docs/references/ai/DocumentMetadata.mdx | 19 + content/docs/references/ai/EmbeddingModel.mdx | 16 + content/docs/references/ai/Entity.mdx | 14 + .../docs/references/ai/FieldSynonymConfig.mdx | 13 + .../docs/references/ai/ModelCapability.mdx | 16 + content/docs/references/ai/ModelConfig.mdx | 23 + content/docs/references/ai/ModelLimits.mdx | 13 + content/docs/references/ai/ModelPricing.mdx | 13 + content/docs/references/ai/ModelProvider.mdx | 15 + content/docs/references/ai/ModelRegistry.mdx | 14 + .../docs/references/ai/ModelRegistryEntry.mdx | 14 + .../references/ai/ModelSelectionCriteria.mdx | 15 + content/docs/references/ai/NLQAnalytics.mdx | 20 + .../docs/references/ai/NLQFieldMapping.mdx | 14 + content/docs/references/ai/NLQModelConfig.mdx | 23 + content/docs/references/ai/NLQParseResult.mdx | 20 + content/docs/references/ai/NLQRequest.mdx | 16 + content/docs/references/ai/NLQResponse.mdx | 15 + .../docs/references/ai/NLQTrainingExample.mdx | 17 + content/docs/references/ai/PromptTemplate.mdx | 28 + content/docs/references/ai/PromptVariable.mdx | 15 + content/docs/references/ai/QueryContext.mdx | 17 + content/docs/references/ai/QueryIntent.mdx | 17 + content/docs/references/ai/QueryTemplate.mdx | 18 + .../docs/references/ai/RAGPipelineConfig.mdx | 24 + .../docs/references/ai/RAGPipelineStatus.mdx | 15 + .../docs/references/ai/RAGQueryRequest.mdx | 16 + .../docs/references/ai/RAGQueryResponse.mdx | 14 + .../docs/references/ai/RerankingConfig.mdx | 13 + .../docs/references/ai/RetrievalStrategy.mdx | 5 + content/docs/references/ai/Timeframe.mdx | 14 + .../docs/references/ai/VectorStoreConfig.mdx | 20 + .../references/ai/VectorStoreProvider.mdx | 17 + .../docs/references/ai/types/FieldMapping.mdx | 13 + .../spec/json-schema/ChunkingStrategy.json | 133 +++++ packages/spec/json-schema/DocumentChunk.json | 97 +++ .../json-schema/DocumentLoaderConfig.json | 69 +++ .../spec/json-schema/DocumentMetadata.json | 61 ++ packages/spec/json-schema/EmbeddingModel.json | 57 ++ packages/spec/json-schema/Entity.json | 55 ++ .../spec/json-schema/FieldSynonymConfig.json | 39 ++ .../spec/json-schema/ModelCapability.json | 47 ++ packages/spec/json-schema/ModelConfig.json | 181 ++++++ packages/spec/json-schema/ModelLimits.json | 45 ++ packages/spec/json-schema/ModelPricing.json | 28 + packages/spec/json-schema/ModelProvider.json | 19 + packages/spec/json-schema/ModelRegistry.json | 427 ++++++++++++++ .../spec/json-schema/ModelRegistryEntry.json | 239 ++++++++ .../json-schema/ModelSelectionCriteria.json | 50 ++ packages/spec/json-schema/NLQAnalytics.json | 106 ++++ .../spec/json-schema/NLQFieldMapping.json | 40 ++ packages/spec/json-schema/NLQModelConfig.json | 78 +++ packages/spec/json-schema/NLQParseResult.json | 252 ++++++++ packages/spec/json-schema/NLQRequest.json | 110 ++++ packages/spec/json-schema/NLQResponse.json | 288 +++++++++ .../spec/json-schema/NLQTrainingExample.json | 120 ++++ packages/spec/json-schema/PromptTemplate.json | 163 ++++++ packages/spec/json-schema/PromptVariable.json | 56 ++ packages/spec/json-schema/QueryContext.json | 72 +++ packages/spec/json-schema/QueryIntent.json | 21 + packages/spec/json-schema/QueryTemplate.json | 81 +++ .../spec/json-schema/RAGPipelineConfig.json | 552 ++++++++++++++++++ .../spec/json-schema/RAGPipelineStatus.json | 66 +++ .../spec/json-schema/RAGQueryRequest.json | 64 ++ .../spec/json-schema/RAGQueryResponse.json | 108 ++++ .../spec/json-schema/RerankingConfig.json | 34 ++ .../spec/json-schema/RetrievalStrategy.json | 121 ++++ packages/spec/json-schema/Timeframe.json | 68 +++ .../spec/json-schema/VectorStoreConfig.json | 82 +++ .../spec/json-schema/VectorStoreProvider.json | 21 + packages/spec/src/ai/nlq.test.ts | 6 +- packages/spec/src/ai/nlq.zod.ts | 9 +- pnpm-lock.yaml | 34 ++ 76 files changed, 4686 insertions(+), 7 deletions(-) create mode 100644 content/docs/references/ai/ChunkingStrategy.mdx create mode 100644 content/docs/references/ai/DocumentChunk.mdx create mode 100644 content/docs/references/ai/DocumentLoaderConfig.mdx create mode 100644 content/docs/references/ai/DocumentMetadata.mdx create mode 100644 content/docs/references/ai/EmbeddingModel.mdx create mode 100644 content/docs/references/ai/Entity.mdx create mode 100644 content/docs/references/ai/FieldSynonymConfig.mdx create mode 100644 content/docs/references/ai/ModelCapability.mdx create mode 100644 content/docs/references/ai/ModelConfig.mdx create mode 100644 content/docs/references/ai/ModelLimits.mdx create mode 100644 content/docs/references/ai/ModelPricing.mdx create mode 100644 content/docs/references/ai/ModelProvider.mdx create mode 100644 content/docs/references/ai/ModelRegistry.mdx create mode 100644 content/docs/references/ai/ModelRegistryEntry.mdx create mode 100644 content/docs/references/ai/ModelSelectionCriteria.mdx create mode 100644 content/docs/references/ai/NLQAnalytics.mdx create mode 100644 content/docs/references/ai/NLQFieldMapping.mdx create mode 100644 content/docs/references/ai/NLQModelConfig.mdx create mode 100644 content/docs/references/ai/NLQParseResult.mdx create mode 100644 content/docs/references/ai/NLQRequest.mdx create mode 100644 content/docs/references/ai/NLQResponse.mdx create mode 100644 content/docs/references/ai/NLQTrainingExample.mdx create mode 100644 content/docs/references/ai/PromptTemplate.mdx create mode 100644 content/docs/references/ai/PromptVariable.mdx create mode 100644 content/docs/references/ai/QueryContext.mdx create mode 100644 content/docs/references/ai/QueryIntent.mdx create mode 100644 content/docs/references/ai/QueryTemplate.mdx create mode 100644 content/docs/references/ai/RAGPipelineConfig.mdx create mode 100644 content/docs/references/ai/RAGPipelineStatus.mdx create mode 100644 content/docs/references/ai/RAGQueryRequest.mdx create mode 100644 content/docs/references/ai/RAGQueryResponse.mdx create mode 100644 content/docs/references/ai/RerankingConfig.mdx create mode 100644 content/docs/references/ai/RetrievalStrategy.mdx create mode 100644 content/docs/references/ai/Timeframe.mdx create mode 100644 content/docs/references/ai/VectorStoreConfig.mdx create mode 100644 content/docs/references/ai/VectorStoreProvider.mdx create mode 100644 content/docs/references/ai/types/FieldMapping.mdx create mode 100644 packages/spec/json-schema/ChunkingStrategy.json create mode 100644 packages/spec/json-schema/DocumentChunk.json create mode 100644 packages/spec/json-schema/DocumentLoaderConfig.json create mode 100644 packages/spec/json-schema/DocumentMetadata.json create mode 100644 packages/spec/json-schema/EmbeddingModel.json create mode 100644 packages/spec/json-schema/Entity.json create mode 100644 packages/spec/json-schema/FieldSynonymConfig.json create mode 100644 packages/spec/json-schema/ModelCapability.json create mode 100644 packages/spec/json-schema/ModelConfig.json create mode 100644 packages/spec/json-schema/ModelLimits.json create mode 100644 packages/spec/json-schema/ModelPricing.json create mode 100644 packages/spec/json-schema/ModelProvider.json create mode 100644 packages/spec/json-schema/ModelRegistry.json create mode 100644 packages/spec/json-schema/ModelRegistryEntry.json create mode 100644 packages/spec/json-schema/ModelSelectionCriteria.json create mode 100644 packages/spec/json-schema/NLQAnalytics.json create mode 100644 packages/spec/json-schema/NLQFieldMapping.json create mode 100644 packages/spec/json-schema/NLQModelConfig.json create mode 100644 packages/spec/json-schema/NLQParseResult.json create mode 100644 packages/spec/json-schema/NLQRequest.json create mode 100644 packages/spec/json-schema/NLQResponse.json create mode 100644 packages/spec/json-schema/NLQTrainingExample.json create mode 100644 packages/spec/json-schema/PromptTemplate.json create mode 100644 packages/spec/json-schema/PromptVariable.json create mode 100644 packages/spec/json-schema/QueryContext.json create mode 100644 packages/spec/json-schema/QueryIntent.json create mode 100644 packages/spec/json-schema/QueryTemplate.json create mode 100644 packages/spec/json-schema/RAGPipelineConfig.json create mode 100644 packages/spec/json-schema/RAGPipelineStatus.json create mode 100644 packages/spec/json-schema/RAGQueryRequest.json create mode 100644 packages/spec/json-schema/RAGQueryResponse.json create mode 100644 packages/spec/json-schema/RerankingConfig.json create mode 100644 packages/spec/json-schema/RetrievalStrategy.json create mode 100644 packages/spec/json-schema/Timeframe.json create mode 100644 packages/spec/json-schema/VectorStoreConfig.json create mode 100644 packages/spec/json-schema/VectorStoreProvider.json diff --git a/content/docs/references/ai/ChunkingStrategy.mdx b/content/docs/references/ai/ChunkingStrategy.mdx new file mode 100644 index 0000000..ccb0916 --- /dev/null +++ b/content/docs/references/ai/ChunkingStrategy.mdx @@ -0,0 +1,5 @@ +--- +title: ChunkingStrategy +description: ChunkingStrategy Schema Reference +--- + diff --git a/content/docs/references/ai/DocumentChunk.mdx b/content/docs/references/ai/DocumentChunk.mdx new file mode 100644 index 0000000..d6d9790 --- /dev/null +++ b/content/docs/references/ai/DocumentChunk.mdx @@ -0,0 +1,15 @@ +--- +title: DocumentChunk +description: DocumentChunk Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | āœ… | Unique chunk identifier | +| **content** | `string` | āœ… | Chunk text content | +| **embedding** | `number[]` | optional | Embedding vector | +| **metadata** | `object` | āœ… | | +| **chunkIndex** | `integer` | āœ… | Chunk position in document | +| **tokens** | `integer` | optional | Token count | diff --git a/content/docs/references/ai/DocumentLoaderConfig.mdx b/content/docs/references/ai/DocumentLoaderConfig.mdx new file mode 100644 index 0000000..887ac30 --- /dev/null +++ b/content/docs/references/ai/DocumentLoaderConfig.mdx @@ -0,0 +1,18 @@ +--- +title: DocumentLoaderConfig +description: DocumentLoaderConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **type** | `Enum<'file' \| 'directory' \| 'url' \| 'api' \| 'database' \| 'custom'>` | āœ… | | +| **source** | `string` | āœ… | Source path, URL, or identifier | +| **fileTypes** | `string[]` | optional | Accepted file extensions (e.g., [".pdf", ".md"]) | +| **recursive** | `boolean` | optional | Process directories recursively | +| **maxFileSize** | `integer` | optional | Maximum file size in bytes | +| **excludePatterns** | `string[]` | optional | Patterns to exclude | +| **extractImages** | `boolean` | optional | Extract text from images (OCR) | +| **extractTables** | `boolean` | optional | Extract and format tables | +| **loaderConfig** | `Record` | optional | Custom loader-specific config | diff --git a/content/docs/references/ai/DocumentMetadata.mdx b/content/docs/references/ai/DocumentMetadata.mdx new file mode 100644 index 0000000..ae125ab --- /dev/null +++ b/content/docs/references/ai/DocumentMetadata.mdx @@ -0,0 +1,19 @@ +--- +title: DocumentMetadata +description: DocumentMetadata Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **source** | `string` | āœ… | Document source (file path, URL, etc.) | +| **sourceType** | `Enum<'file' \| 'url' \| 'api' \| 'database' \| 'custom'>` | optional | | +| **title** | `string` | optional | | +| **author** | `string` | optional | | +| **createdAt** | `string` | optional | ISO timestamp | +| **updatedAt** | `string` | optional | ISO timestamp | +| **tags** | `string[]` | optional | | +| **category** | `string` | optional | | +| **language** | `string` | optional | Document language (ISO 639-1 code) | +| **custom** | `Record` | optional | Custom metadata fields | diff --git a/content/docs/references/ai/EmbeddingModel.mdx b/content/docs/references/ai/EmbeddingModel.mdx new file mode 100644 index 0000000..7d581b2 --- /dev/null +++ b/content/docs/references/ai/EmbeddingModel.mdx @@ -0,0 +1,16 @@ +--- +title: EmbeddingModel +description: EmbeddingModel Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **provider** | `Enum<'openai' \| 'cohere' \| 'huggingface' \| 'azure_openai' \| 'local' \| 'custom'>` | āœ… | | +| **model** | `string` | āœ… | Model name (e.g., "text-embedding-3-large") | +| **dimensions** | `integer` | āœ… | Embedding vector dimensions | +| **maxTokens** | `integer` | optional | Maximum tokens per embedding | +| **batchSize** | `integer` | optional | Batch size for embedding | +| **endpoint** | `string` | optional | Custom endpoint URL | +| **apiKey** | `string` | optional | API key or reference to secret | diff --git a/content/docs/references/ai/Entity.mdx b/content/docs/references/ai/Entity.mdx new file mode 100644 index 0000000..94de35e --- /dev/null +++ b/content/docs/references/ai/Entity.mdx @@ -0,0 +1,14 @@ +--- +title: Entity +description: Entity Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **type** | `Enum<'object' \| 'field' \| 'value' \| 'operator' \| 'function' \| 'timeframe'>` | āœ… | | +| **text** | `string` | āœ… | Original text from query | +| **value** | `any` | optional | Normalized value | +| **confidence** | `number` | āœ… | Confidence score | +| **span** | `any[]` | optional | Character span in query | diff --git a/content/docs/references/ai/FieldSynonymConfig.mdx b/content/docs/references/ai/FieldSynonymConfig.mdx new file mode 100644 index 0000000..a7f454f --- /dev/null +++ b/content/docs/references/ai/FieldSynonymConfig.mdx @@ -0,0 +1,13 @@ +--- +title: FieldSynonymConfig +description: FieldSynonymConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **object** | `string` | āœ… | Object name | +| **field** | `string` | āœ… | Field name | +| **synonyms** | `string[]` | āœ… | Natural language synonyms | +| **examples** | `string[]` | optional | Example queries using synonyms | diff --git a/content/docs/references/ai/ModelCapability.mdx b/content/docs/references/ai/ModelCapability.mdx new file mode 100644 index 0000000..6773ec5 --- /dev/null +++ b/content/docs/references/ai/ModelCapability.mdx @@ -0,0 +1,16 @@ +--- +title: ModelCapability +description: ModelCapability Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **textGeneration** | `boolean` | optional | Supports text generation | +| **textEmbedding** | `boolean` | optional | Supports text embedding | +| **imageGeneration** | `boolean` | optional | Supports image generation | +| **imageUnderstanding** | `boolean` | optional | Supports image understanding | +| **functionCalling** | `boolean` | optional | Supports function calling | +| **codeGeneration** | `boolean` | optional | Supports code generation | +| **reasoning** | `boolean` | optional | Supports advanced reasoning | diff --git a/content/docs/references/ai/ModelConfig.mdx b/content/docs/references/ai/ModelConfig.mdx new file mode 100644 index 0000000..7785c0d --- /dev/null +++ b/content/docs/references/ai/ModelConfig.mdx @@ -0,0 +1,23 @@ +--- +title: ModelConfig +description: ModelConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | āœ… | Unique model identifier | +| **name** | `string` | āœ… | Model display name | +| **version** | `string` | āœ… | Model version (e.g., "gpt-4-turbo-2024-04-09") | +| **provider** | `Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'google' \| 'cohere' \| 'huggingface' \| 'local' \| 'custom'>` | āœ… | | +| **capabilities** | `object` | āœ… | | +| **limits** | `object` | āœ… | | +| **pricing** | `object` | optional | | +| **endpoint** | `string` | optional | Custom API endpoint | +| **apiKey** | `string` | optional | API key or reference to secret | +| **region** | `string` | optional | Deployment region (e.g., "us-east-1") | +| **description** | `string` | optional | | +| **tags** | `string[]` | optional | Tags for categorization | +| **deprecated** | `boolean` | optional | | +| **recommendedFor** | `string[]` | optional | Use case recommendations | diff --git a/content/docs/references/ai/ModelLimits.mdx b/content/docs/references/ai/ModelLimits.mdx new file mode 100644 index 0000000..ca682a1 --- /dev/null +++ b/content/docs/references/ai/ModelLimits.mdx @@ -0,0 +1,13 @@ +--- +title: ModelLimits +description: ModelLimits Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **maxTokens** | `integer` | āœ… | Maximum tokens per request | +| **contextWindow** | `integer` | āœ… | Context window size | +| **maxOutputTokens** | `integer` | optional | Maximum output tokens | +| **rateLimit** | `object` | optional | | diff --git a/content/docs/references/ai/ModelPricing.mdx b/content/docs/references/ai/ModelPricing.mdx new file mode 100644 index 0000000..d94a828 --- /dev/null +++ b/content/docs/references/ai/ModelPricing.mdx @@ -0,0 +1,13 @@ +--- +title: ModelPricing +description: ModelPricing Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **currency** | `string` | optional | | +| **inputCostPer1kTokens** | `number` | optional | Cost per 1K input tokens | +| **outputCostPer1kTokens** | `number` | optional | Cost per 1K output tokens | +| **embeddingCostPer1kTokens** | `number` | optional | Cost per 1K embedding tokens | diff --git a/content/docs/references/ai/ModelProvider.mdx b/content/docs/references/ai/ModelProvider.mdx new file mode 100644 index 0000000..3f98f0f --- /dev/null +++ b/content/docs/references/ai/ModelProvider.mdx @@ -0,0 +1,15 @@ +--- +title: ModelProvider +description: ModelProvider Schema Reference +--- + +## Allowed Values + +* `openai` +* `azure_openai` +* `anthropic` +* `google` +* `cohere` +* `huggingface` +* `local` +* `custom` \ No newline at end of file diff --git a/content/docs/references/ai/ModelRegistry.mdx b/content/docs/references/ai/ModelRegistry.mdx new file mode 100644 index 0000000..a389e1c --- /dev/null +++ b/content/docs/references/ai/ModelRegistry.mdx @@ -0,0 +1,14 @@ +--- +title: ModelRegistry +description: ModelRegistry Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | āœ… | Registry name | +| **models** | `Record` | āœ… | Model entries by ID | +| **promptTemplates** | `Record` | optional | Prompt templates by name | +| **defaultModel** | `string` | optional | Default model ID | +| **enableAutoFallback** | `boolean` | optional | Auto-fallback on errors | diff --git a/content/docs/references/ai/ModelRegistryEntry.mdx b/content/docs/references/ai/ModelRegistryEntry.mdx new file mode 100644 index 0000000..6fe82e3 --- /dev/null +++ b/content/docs/references/ai/ModelRegistryEntry.mdx @@ -0,0 +1,14 @@ +--- +title: ModelRegistryEntry +description: ModelRegistryEntry Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **model** | `object` | āœ… | | +| **status** | `Enum<'active' \| 'deprecated' \| 'experimental' \| 'disabled'>` | optional | | +| **priority** | `integer` | optional | Priority for model selection | +| **fallbackModels** | `string[]` | optional | Fallback model IDs | +| **healthCheck** | `object` | optional | | diff --git a/content/docs/references/ai/ModelSelectionCriteria.mdx b/content/docs/references/ai/ModelSelectionCriteria.mdx new file mode 100644 index 0000000..c3ee794 --- /dev/null +++ b/content/docs/references/ai/ModelSelectionCriteria.mdx @@ -0,0 +1,15 @@ +--- +title: ModelSelectionCriteria +description: ModelSelectionCriteria Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **capabilities** | `string[]` | optional | Required capabilities | +| **maxCostPer1kTokens** | `number` | optional | Maximum acceptable cost | +| **minContextWindow** | `number` | optional | Minimum context window size | +| **provider** | `Enum<'openai' \| 'azure_openai' \| 'anthropic' \| 'google' \| 'cohere' \| 'huggingface' \| 'local' \| 'custom'>` | optional | | +| **tags** | `string[]` | optional | | +| **excludeDeprecated** | `boolean` | optional | | diff --git a/content/docs/references/ai/NLQAnalytics.mdx b/content/docs/references/ai/NLQAnalytics.mdx new file mode 100644 index 0000000..f680f71 --- /dev/null +++ b/content/docs/references/ai/NLQAnalytics.mdx @@ -0,0 +1,20 @@ +--- +title: NLQAnalytics +description: NLQAnalytics Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **totalQueries** | `integer` | āœ… | | +| **successfulQueries** | `integer` | āœ… | | +| **failedQueries** | `integer` | āœ… | | +| **averageConfidence** | `number` | āœ… | | +| **intentDistribution** | `Record` | āœ… | Count by intent type | +| **topQueries** | `object[]` | āœ… | | +| **averageParseTime** | `number` | āœ… | Average parse time in milliseconds | +| **averageExecutionTime** | `number` | optional | | +| **lowConfidenceQueries** | `object[]` | āœ… | | +| **startDate** | `string` | āœ… | ISO timestamp | +| **endDate** | `string` | āœ… | ISO timestamp | diff --git a/content/docs/references/ai/NLQFieldMapping.mdx b/content/docs/references/ai/NLQFieldMapping.mdx new file mode 100644 index 0000000..872571d --- /dev/null +++ b/content/docs/references/ai/NLQFieldMapping.mdx @@ -0,0 +1,14 @@ +--- +title: NLQFieldMapping +description: NLQFieldMapping Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **naturalLanguage** | `string` | āœ… | NL field name (e.g., "customer name") | +| **objectField** | `string` | āœ… | Actual field name (e.g., "account.name") | +| **object** | `string` | āœ… | Object name | +| **field** | `string` | āœ… | Field name | +| **confidence** | `number` | āœ… | | diff --git a/content/docs/references/ai/NLQModelConfig.mdx b/content/docs/references/ai/NLQModelConfig.mdx new file mode 100644 index 0000000..00f845a --- /dev/null +++ b/content/docs/references/ai/NLQModelConfig.mdx @@ -0,0 +1,23 @@ +--- +title: NLQModelConfig +description: NLQModelConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **modelId** | `string` | āœ… | Model from registry | +| **systemPrompt** | `string` | optional | System prompt override | +| **includeSchema** | `boolean` | optional | Include object schema in prompt | +| **includeExamples** | `boolean` | optional | Include examples in prompt | +| **enableIntentDetection** | `boolean` | optional | | +| **intentThreshold** | `number` | optional | | +| **enableEntityRecognition** | `boolean` | optional | | +| **entityRecognitionModel** | `string` | optional | | +| **enableFuzzyMatching** | `boolean` | optional | Fuzzy match field names | +| **fuzzyMatchThreshold** | `number` | optional | | +| **enableTimeframeDetection** | `boolean` | optional | | +| **defaultTimeframe** | `string` | optional | Default timeframe if not specified | +| **enableCaching** | `boolean` | optional | | +| **cacheTTL** | `integer` | optional | Cache TTL in seconds | diff --git a/content/docs/references/ai/NLQParseResult.mdx b/content/docs/references/ai/NLQParseResult.mdx new file mode 100644 index 0000000..9394bb6 --- /dev/null +++ b/content/docs/references/ai/NLQParseResult.mdx @@ -0,0 +1,20 @@ +--- +title: NLQParseResult +description: NLQParseResult Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **originalQuery** | `string` | āœ… | | +| **intent** | `Enum<'select' \| 'aggregate' \| 'filter' \| 'sort' \| 'compare' \| 'trend' \| 'insight' \| 'create' \| 'update' \| 'delete'>` | āœ… | | +| **intentConfidence** | `number` | āœ… | | +| **entities** | `object[]` | āœ… | | +| **targetObject** | `string` | optional | Primary object to query | +| **fields** | `object[]` | optional | | +| **timeframe** | `object` | optional | | +| **ast** | `any` | optional | Generated ObjectQL AST | +| **confidence** | `number` | āœ… | Overall confidence | +| **ambiguities** | `object[]` | optional | Detected ambiguities requiring clarification | +| **alternatives** | `object[]` | optional | | diff --git a/content/docs/references/ai/NLQRequest.mdx b/content/docs/references/ai/NLQRequest.mdx new file mode 100644 index 0000000..b19c9e3 --- /dev/null +++ b/content/docs/references/ai/NLQRequest.mdx @@ -0,0 +1,16 @@ +--- +title: NLQRequest +description: NLQRequest Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **query** | `string` | āœ… | Natural language query | +| **context** | `object` | optional | | +| **includeAlternatives** | `boolean` | optional | Include alternative interpretations | +| **maxAlternatives** | `integer` | optional | | +| **minConfidence** | `number` | optional | Minimum confidence threshold | +| **executeQuery** | `boolean` | optional | Execute query and return results | +| **maxResults** | `integer` | optional | Maximum results to return | diff --git a/content/docs/references/ai/NLQResponse.mdx b/content/docs/references/ai/NLQResponse.mdx new file mode 100644 index 0000000..1f95393 --- /dev/null +++ b/content/docs/references/ai/NLQResponse.mdx @@ -0,0 +1,15 @@ +--- +title: NLQResponse +description: NLQResponse Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **parseResult** | `object` | āœ… | | +| **results** | `Record[]` | optional | Query results | +| **totalCount** | `integer` | optional | | +| **executionTime** | `number` | optional | Execution time in milliseconds | +| **needsClarification** | `boolean` | āœ… | Whether query needs clarification | +| **suggestions** | `string[]` | optional | Query refinement suggestions | diff --git a/content/docs/references/ai/NLQTrainingExample.mdx b/content/docs/references/ai/NLQTrainingExample.mdx new file mode 100644 index 0000000..b1ed094 --- /dev/null +++ b/content/docs/references/ai/NLQTrainingExample.mdx @@ -0,0 +1,17 @@ +--- +title: NLQTrainingExample +description: NLQTrainingExample Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **query** | `string` | āœ… | Natural language query | +| **context** | `object` | optional | | +| **expectedIntent** | `Enum<'select' \| 'aggregate' \| 'filter' \| 'sort' \| 'compare' \| 'trend' \| 'insight' \| 'create' \| 'update' \| 'delete'>` | āœ… | | +| **expectedObject** | `string` | optional | | +| **expectedAST** | `any` | optional | Expected ObjectQL AST | +| **category** | `string` | optional | Example category | +| **tags** | `string[]` | optional | | +| **notes** | `string` | optional | | diff --git a/content/docs/references/ai/PromptTemplate.mdx b/content/docs/references/ai/PromptTemplate.mdx new file mode 100644 index 0000000..437bda4 --- /dev/null +++ b/content/docs/references/ai/PromptTemplate.mdx @@ -0,0 +1,28 @@ +--- +title: PromptTemplate +description: PromptTemplate Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | āœ… | Unique template identifier | +| **name** | `string` | āœ… | Template name (snake_case) | +| **label** | `string` | āœ… | Display name | +| **system** | `string` | optional | System prompt | +| **user** | `string` | āœ… | User prompt template with variables | +| **assistant** | `string` | optional | Assistant message prefix | +| **variables** | `object[]` | optional | Template variables | +| **modelId** | `string` | optional | Recommended model ID | +| **temperature** | `number` | optional | | +| **maxTokens** | `number` | optional | | +| **topP** | `number` | optional | | +| **frequencyPenalty** | `number` | optional | | +| **presencePenalty** | `number` | optional | | +| **stopSequences** | `string[]` | optional | | +| **version** | `string` | optional | | +| **description** | `string` | optional | | +| **category** | `string` | optional | Template category (e.g., "code_generation", "support") | +| **tags** | `string[]` | optional | | +| **examples** | `object[]` | optional | | diff --git a/content/docs/references/ai/PromptVariable.mdx b/content/docs/references/ai/PromptVariable.mdx new file mode 100644 index 0000000..10b6940 --- /dev/null +++ b/content/docs/references/ai/PromptVariable.mdx @@ -0,0 +1,15 @@ +--- +title: PromptVariable +description: PromptVariable Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | āœ… | Variable name (e.g., "user_name", "context") | +| **type** | `Enum<'string' \| 'number' \| 'boolean' \| 'object' \| 'array'>` | optional | | +| **required** | `boolean` | optional | | +| **defaultValue** | `any` | optional | | +| **description** | `string` | optional | | +| **validation** | `object` | optional | | diff --git a/content/docs/references/ai/QueryContext.mdx b/content/docs/references/ai/QueryContext.mdx new file mode 100644 index 0000000..1651dda --- /dev/null +++ b/content/docs/references/ai/QueryContext.mdx @@ -0,0 +1,17 @@ +--- +title: QueryContext +description: QueryContext Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **userId** | `string` | optional | | +| **userRole** | `string` | optional | | +| **currentObject** | `string` | optional | Current object being viewed | +| **currentRecordId** | `string` | optional | Current record ID | +| **conversationHistory** | `object[]` | optional | | +| **defaultLimit** | `integer` | optional | | +| **timezone** | `string` | optional | | +| **locale** | `string` | optional | | diff --git a/content/docs/references/ai/QueryIntent.mdx b/content/docs/references/ai/QueryIntent.mdx new file mode 100644 index 0000000..378c0a7 --- /dev/null +++ b/content/docs/references/ai/QueryIntent.mdx @@ -0,0 +1,17 @@ +--- +title: QueryIntent +description: QueryIntent Schema Reference +--- + +## Allowed Values + +* `select` +* `aggregate` +* `filter` +* `sort` +* `compare` +* `trend` +* `insight` +* `create` +* `update` +* `delete` \ No newline at end of file diff --git a/content/docs/references/ai/QueryTemplate.mdx b/content/docs/references/ai/QueryTemplate.mdx new file mode 100644 index 0000000..aac5d70 --- /dev/null +++ b/content/docs/references/ai/QueryTemplate.mdx @@ -0,0 +1,18 @@ +--- +title: QueryTemplate +description: QueryTemplate Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **id** | `string` | āœ… | | +| **name** | `string` | āœ… | Template name (snake_case) | +| **label** | `string` | āœ… | | +| **pattern** | `string` | āœ… | Query pattern with placeholders | +| **variables** | `object[]` | āœ… | | +| **astTemplate** | `any` | optional | AST template with variable placeholders | +| **category** | `string` | optional | | +| **examples** | `string[]` | optional | | +| **tags** | `string[]` | optional | | diff --git a/content/docs/references/ai/RAGPipelineConfig.mdx b/content/docs/references/ai/RAGPipelineConfig.mdx new file mode 100644 index 0000000..74f5433 --- /dev/null +++ b/content/docs/references/ai/RAGPipelineConfig.mdx @@ -0,0 +1,24 @@ +--- +title: RAGPipelineConfig +description: RAGPipelineConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | āœ… | Pipeline name (snake_case) | +| **label** | `string` | āœ… | Display name | +| **description** | `string` | optional | | +| **embedding** | `object` | āœ… | | +| **vectorStore** | `object` | āœ… | | +| **chunking** | `object \| object \| object \| object` | āœ… | | +| **retrieval** | `object \| object \| object \| object` | āœ… | | +| **reranking** | `object` | optional | | +| **loaders** | `object[]` | optional | Document loaders | +| **maxContextTokens** | `integer` | optional | Maximum tokens in context | +| **contextWindow** | `integer` | optional | LLM context window size | +| **metadataFilters** | `Record` | optional | Filters for retrieval (e.g., `{category: "docs", status: "published"}`) | +| **enableCache** | `boolean` | optional | | +| **cacheTTL** | `integer` | optional | Cache TTL in seconds | +| **cacheInvalidationStrategy** | `Enum<'time_based' \| 'manual' \| 'on_update'>` | optional | | diff --git a/content/docs/references/ai/RAGPipelineStatus.mdx b/content/docs/references/ai/RAGPipelineStatus.mdx new file mode 100644 index 0000000..daffa4d --- /dev/null +++ b/content/docs/references/ai/RAGPipelineStatus.mdx @@ -0,0 +1,15 @@ +--- +title: RAGPipelineStatus +description: RAGPipelineStatus Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **name** | `string` | āœ… | | +| **status** | `Enum<'active' \| 'indexing' \| 'error' \| 'disabled'>` | āœ… | | +| **documentsIndexed** | `integer` | āœ… | | +| **lastIndexed** | `string` | optional | ISO timestamp | +| **errorMessage** | `string` | optional | | +| **health** | `object` | optional | | diff --git a/content/docs/references/ai/RAGQueryRequest.mdx b/content/docs/references/ai/RAGQueryRequest.mdx new file mode 100644 index 0000000..734d8aa --- /dev/null +++ b/content/docs/references/ai/RAGQueryRequest.mdx @@ -0,0 +1,16 @@ +--- +title: RAGQueryRequest +description: RAGQueryRequest Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **query** | `string` | āœ… | User query | +| **pipelineName** | `string` | āœ… | Pipeline to use | +| **topK** | `integer` | optional | | +| **metadataFilters** | `Record` | optional | | +| **conversationHistory** | `object[]` | optional | | +| **includeMetadata** | `boolean` | optional | | +| **includeSources** | `boolean` | optional | | diff --git a/content/docs/references/ai/RAGQueryResponse.mdx b/content/docs/references/ai/RAGQueryResponse.mdx new file mode 100644 index 0000000..d33cdad --- /dev/null +++ b/content/docs/references/ai/RAGQueryResponse.mdx @@ -0,0 +1,14 @@ +--- +title: RAGQueryResponse +description: RAGQueryResponse Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **query** | `string` | āœ… | | +| **results** | `object[]` | āœ… | | +| **context** | `string` | āœ… | Assembled context for LLM | +| **tokensUsed** | `integer` | optional | | +| **retrievalTime** | `number` | optional | Retrieval time in milliseconds | diff --git a/content/docs/references/ai/RerankingConfig.mdx b/content/docs/references/ai/RerankingConfig.mdx new file mode 100644 index 0000000..7cfb7e3 --- /dev/null +++ b/content/docs/references/ai/RerankingConfig.mdx @@ -0,0 +1,13 @@ +--- +title: RerankingConfig +description: RerankingConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **enabled** | `boolean` | optional | | +| **model** | `string` | optional | Reranking model name | +| **provider** | `Enum<'cohere' \| 'huggingface' \| 'custom'>` | optional | | +| **topK** | `integer` | optional | Final number of results after reranking | diff --git a/content/docs/references/ai/RetrievalStrategy.mdx b/content/docs/references/ai/RetrievalStrategy.mdx new file mode 100644 index 0000000..25d9e6d --- /dev/null +++ b/content/docs/references/ai/RetrievalStrategy.mdx @@ -0,0 +1,5 @@ +--- +title: RetrievalStrategy +description: RetrievalStrategy Schema Reference +--- + diff --git a/content/docs/references/ai/Timeframe.mdx b/content/docs/references/ai/Timeframe.mdx new file mode 100644 index 0000000..5f6a0d8 --- /dev/null +++ b/content/docs/references/ai/Timeframe.mdx @@ -0,0 +1,14 @@ +--- +title: Timeframe +description: Timeframe Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **type** | `Enum<'absolute' \| 'relative'>` | āœ… | | +| **start** | `string` | optional | Start date (ISO format) | +| **end** | `string` | optional | End date (ISO format) | +| **relative** | `object` | optional | | +| **text** | `string` | āœ… | Original timeframe text | diff --git a/content/docs/references/ai/VectorStoreConfig.mdx b/content/docs/references/ai/VectorStoreConfig.mdx new file mode 100644 index 0000000..db3bd3f --- /dev/null +++ b/content/docs/references/ai/VectorStoreConfig.mdx @@ -0,0 +1,20 @@ +--- +title: VectorStoreConfig +description: VectorStoreConfig Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **provider** | `Enum<'pinecone' \| 'weaviate' \| 'qdrant' \| 'milvus' \| 'chroma' \| 'pgvector' \| 'redis' \| 'opensearch' \| 'elasticsearch' \| 'custom'>` | āœ… | | +| **indexName** | `string` | āœ… | Index/collection name | +| **namespace** | `string` | optional | Namespace for multi-tenancy | +| **host** | `string` | optional | Vector store host | +| **port** | `integer` | optional | Vector store port | +| **apiKey** | `string` | optional | API key or reference to secret | +| **dimensions** | `integer` | āœ… | Vector dimensions | +| **metric** | `Enum<'cosine' \| 'euclidean' \| 'dotproduct'>` | optional | | +| **batchSize** | `integer` | optional | | +| **connectionPoolSize** | `integer` | optional | | +| **timeout** | `integer` | optional | Timeout in milliseconds | diff --git a/content/docs/references/ai/VectorStoreProvider.mdx b/content/docs/references/ai/VectorStoreProvider.mdx new file mode 100644 index 0000000..37c6435 --- /dev/null +++ b/content/docs/references/ai/VectorStoreProvider.mdx @@ -0,0 +1,17 @@ +--- +title: VectorStoreProvider +description: VectorStoreProvider Schema Reference +--- + +## Allowed Values + +* `pinecone` +* `weaviate` +* `qdrant` +* `milvus` +* `chroma` +* `pgvector` +* `redis` +* `opensearch` +* `elasticsearch` +* `custom` \ No newline at end of file diff --git a/content/docs/references/ai/types/FieldMapping.mdx b/content/docs/references/ai/types/FieldMapping.mdx new file mode 100644 index 0000000..aa3c343 --- /dev/null +++ b/content/docs/references/ai/types/FieldMapping.mdx @@ -0,0 +1,13 @@ +--- +title: FieldMapping +description: FieldMapping Schema Reference +--- + +## Properties + +| Property | Type | Required | Description | +| :--- | :--- | :--- | :--- | +| **source** | `string \| string[]` | āœ… | Source column header(s) | +| **target** | `string \| string[]` | āœ… | Target object field(s) | +| **transform** | `Enum<'none' \| 'constant' \| 'lookup' \| 'split' \| 'join' \| 'javascript' \| 'map'>` | optional | | +| **params** | `object` | optional | | diff --git a/packages/spec/json-schema/ChunkingStrategy.json b/packages/spec/json-schema/ChunkingStrategy.json new file mode 100644 index 0000000..3147a26 --- /dev/null +++ b/packages/spec/json-schema/ChunkingStrategy.json @@ -0,0 +1,133 @@ +{ + "$ref": "#/definitions/ChunkingStrategy", + "definitions": { + "ChunkingStrategy": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "chunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Fixed chunk size in tokens/chars" + }, + "chunkOverlap": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "Overlap between chunks" + }, + "unit": { + "type": "string", + "enum": [ + "tokens", + "characters" + ], + "default": "tokens" + } + }, + "required": [ + "type", + "chunkSize" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "semantic" + }, + "model": { + "type": "string", + "description": "Model for semantic chunking" + }, + "minChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100 + }, + "maxChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 1000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "recursive" + }, + "separators": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "\n\n", + "\n", + " ", + "" + ] + }, + "chunkSize": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "chunkOverlap": { + "type": "integer", + "minimum": 0, + "default": 0 + } + }, + "required": [ + "type", + "chunkSize" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "markdown" + }, + "maxChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 1000 + }, + "respectHeaders": { + "type": "boolean", + "default": true, + "description": "Keep headers with content" + }, + "respectCodeBlocks": { + "type": "boolean", + "default": true, + "description": "Keep code blocks intact" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/DocumentChunk.json b/packages/spec/json-schema/DocumentChunk.json new file mode 100644 index 0000000..23b50b1 --- /dev/null +++ b/packages/spec/json-schema/DocumentChunk.json @@ -0,0 +1,97 @@ +{ + "$ref": "#/definitions/DocumentChunk", + "definitions": { + "DocumentChunk": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique chunk identifier" + }, + "content": { + "type": "string", + "description": "Chunk text content" + }, + "embedding": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Embedding vector" + }, + "metadata": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Document source (file path, URL, etc.)" + }, + "sourceType": { + "type": "string", + "enum": [ + "file", + "url", + "api", + "database", + "custom" + ] + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "ISO timestamp" + }, + "updatedAt": { + "type": "string", + "description": "ISO timestamp" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": "string" + }, + "language": { + "type": "string", + "description": "Document language (ISO 639-1 code)" + }, + "custom": { + "type": "object", + "additionalProperties": {}, + "description": "Custom metadata fields" + } + }, + "required": [ + "source" + ], + "additionalProperties": false + }, + "chunkIndex": { + "type": "integer", + "minimum": 0, + "description": "Chunk position in document" + }, + "tokens": { + "type": "integer", + "description": "Token count" + } + }, + "required": [ + "id", + "content", + "metadata", + "chunkIndex" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/DocumentLoaderConfig.json b/packages/spec/json-schema/DocumentLoaderConfig.json new file mode 100644 index 0000000..edfecf3 --- /dev/null +++ b/packages/spec/json-schema/DocumentLoaderConfig.json @@ -0,0 +1,69 @@ +{ + "$ref": "#/definitions/DocumentLoaderConfig", + "definitions": { + "DocumentLoaderConfig": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "file", + "directory", + "url", + "api", + "database", + "custom" + ] + }, + "source": { + "type": "string", + "description": "Source path, URL, or identifier" + }, + "fileTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Accepted file extensions (e.g., [\".pdf\", \".md\"])" + }, + "recursive": { + "type": "boolean", + "default": false, + "description": "Process directories recursively" + }, + "maxFileSize": { + "type": "integer", + "description": "Maximum file size in bytes" + }, + "excludePatterns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Patterns to exclude" + }, + "extractImages": { + "type": "boolean", + "default": false, + "description": "Extract text from images (OCR)" + }, + "extractTables": { + "type": "boolean", + "default": false, + "description": "Extract and format tables" + }, + "loaderConfig": { + "type": "object", + "additionalProperties": {}, + "description": "Custom loader-specific config" + } + }, + "required": [ + "type", + "source" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/DocumentMetadata.json b/packages/spec/json-schema/DocumentMetadata.json new file mode 100644 index 0000000..fcf7493 --- /dev/null +++ b/packages/spec/json-schema/DocumentMetadata.json @@ -0,0 +1,61 @@ +{ + "$ref": "#/definitions/DocumentMetadata", + "definitions": { + "DocumentMetadata": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Document source (file path, URL, etc.)" + }, + "sourceType": { + "type": "string", + "enum": [ + "file", + "url", + "api", + "database", + "custom" + ] + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "ISO timestamp" + }, + "updatedAt": { + "type": "string", + "description": "ISO timestamp" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": "string" + }, + "language": { + "type": "string", + "description": "Document language (ISO 639-1 code)" + }, + "custom": { + "type": "object", + "additionalProperties": {}, + "description": "Custom metadata fields" + } + }, + "required": [ + "source" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/EmbeddingModel.json b/packages/spec/json-schema/EmbeddingModel.json new file mode 100644 index 0000000..ae6a035 --- /dev/null +++ b/packages/spec/json-schema/EmbeddingModel.json @@ -0,0 +1,57 @@ +{ + "$ref": "#/definitions/EmbeddingModel", + "definitions": { + "EmbeddingModel": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "openai", + "cohere", + "huggingface", + "azure_openai", + "local", + "custom" + ] + }, + "model": { + "type": "string", + "description": "Model name (e.g., \"text-embedding-3-large\")" + }, + "dimensions": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Embedding vector dimensions" + }, + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per embedding" + }, + "batchSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100, + "description": "Batch size for embedding" + }, + "endpoint": { + "type": "string", + "format": "uri", + "description": "Custom endpoint URL" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + } + }, + "required": [ + "provider", + "model", + "dimensions" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/Entity.json b/packages/spec/json-schema/Entity.json new file mode 100644 index 0000000..6f82a07 --- /dev/null +++ b/packages/spec/json-schema/Entity.json @@ -0,0 +1,55 @@ +{ + "$ref": "#/definitions/Entity", + "definitions": { + "Entity": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "object", + "field", + "value", + "operator", + "function", + "timeframe" + ] + }, + "text": { + "type": "string", + "description": "Original text from query" + }, + "value": { + "description": "Normalized value" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Confidence score" + }, + "span": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "description": "Character span in query" + } + }, + "required": [ + "type", + "text", + "confidence" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/FieldSynonymConfig.json b/packages/spec/json-schema/FieldSynonymConfig.json new file mode 100644 index 0000000..e41f385 --- /dev/null +++ b/packages/spec/json-schema/FieldSynonymConfig.json @@ -0,0 +1,39 @@ +{ + "$ref": "#/definitions/FieldSynonymConfig", + "definitions": { + "FieldSynonymConfig": { + "type": "object", + "properties": { + "object": { + "type": "string", + "description": "Object name" + }, + "field": { + "type": "string", + "description": "Field name" + }, + "synonyms": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Natural language synonyms" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Example queries using synonyms" + } + }, + "required": [ + "object", + "field", + "synonyms" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelCapability.json b/packages/spec/json-schema/ModelCapability.json new file mode 100644 index 0000000..976b0a2 --- /dev/null +++ b/packages/spec/json-schema/ModelCapability.json @@ -0,0 +1,47 @@ +{ + "$ref": "#/definitions/ModelCapability", + "definitions": { + "ModelCapability": { + "type": "object", + "properties": { + "textGeneration": { + "type": "boolean", + "default": true, + "description": "Supports text generation" + }, + "textEmbedding": { + "type": "boolean", + "default": false, + "description": "Supports text embedding" + }, + "imageGeneration": { + "type": "boolean", + "default": false, + "description": "Supports image generation" + }, + "imageUnderstanding": { + "type": "boolean", + "default": false, + "description": "Supports image understanding" + }, + "functionCalling": { + "type": "boolean", + "default": false, + "description": "Supports function calling" + }, + "codeGeneration": { + "type": "boolean", + "default": false, + "description": "Supports code generation" + }, + "reasoning": { + "type": "boolean", + "default": false, + "description": "Supports advanced reasoning" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelConfig.json b/packages/spec/json-schema/ModelConfig.json new file mode 100644 index 0000000..7220acf --- /dev/null +++ b/packages/spec/json-schema/ModelConfig.json @@ -0,0 +1,181 @@ +{ + "$ref": "#/definitions/ModelConfig", + "definitions": { + "ModelConfig": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique model identifier" + }, + "name": { + "type": "string", + "description": "Model display name" + }, + "version": { + "type": "string", + "description": "Model version (e.g., \"gpt-4-turbo-2024-04-09\")" + }, + "provider": { + "type": "string", + "enum": [ + "openai", + "azure_openai", + "anthropic", + "google", + "cohere", + "huggingface", + "local", + "custom" + ] + }, + "capabilities": { + "type": "object", + "properties": { + "textGeneration": { + "type": "boolean", + "default": true, + "description": "Supports text generation" + }, + "textEmbedding": { + "type": "boolean", + "default": false, + "description": "Supports text embedding" + }, + "imageGeneration": { + "type": "boolean", + "default": false, + "description": "Supports image generation" + }, + "imageUnderstanding": { + "type": "boolean", + "default": false, + "description": "Supports image understanding" + }, + "functionCalling": { + "type": "boolean", + "default": false, + "description": "Supports function calling" + }, + "codeGeneration": { + "type": "boolean", + "default": false, + "description": "Supports code generation" + }, + "reasoning": { + "type": "boolean", + "default": false, + "description": "Supports advanced reasoning" + } + }, + "additionalProperties": false + }, + "limits": { + "type": "object", + "properties": { + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per request" + }, + "contextWindow": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Context window size" + }, + "maxOutputTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum output tokens" + }, + "rateLimit": { + "type": "object", + "properties": { + "requestsPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "tokensPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + } + }, + "additionalProperties": false + } + }, + "required": [ + "maxTokens", + "contextWindow" + ], + "additionalProperties": false + }, + "pricing": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "default": "USD" + }, + "inputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K input tokens" + }, + "outputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K output tokens" + }, + "embeddingCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K embedding tokens" + } + }, + "additionalProperties": false + }, + "endpoint": { + "type": "string", + "format": "uri", + "description": "Custom API endpoint" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + }, + "region": { + "type": "string", + "description": "Deployment region (e.g., \"us-east-1\")" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags for categorization" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "recommendedFor": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Use case recommendations" + } + }, + "required": [ + "id", + "name", + "version", + "provider", + "capabilities", + "limits" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelLimits.json b/packages/spec/json-schema/ModelLimits.json new file mode 100644 index 0000000..551aeed --- /dev/null +++ b/packages/spec/json-schema/ModelLimits.json @@ -0,0 +1,45 @@ +{ + "$ref": "#/definitions/ModelLimits", + "definitions": { + "ModelLimits": { + "type": "object", + "properties": { + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per request" + }, + "contextWindow": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Context window size" + }, + "maxOutputTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum output tokens" + }, + "rateLimit": { + "type": "object", + "properties": { + "requestsPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "tokensPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + } + }, + "additionalProperties": false + } + }, + "required": [ + "maxTokens", + "contextWindow" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelPricing.json b/packages/spec/json-schema/ModelPricing.json new file mode 100644 index 0000000..c6392cf --- /dev/null +++ b/packages/spec/json-schema/ModelPricing.json @@ -0,0 +1,28 @@ +{ + "$ref": "#/definitions/ModelPricing", + "definitions": { + "ModelPricing": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "default": "USD" + }, + "inputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K input tokens" + }, + "outputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K output tokens" + }, + "embeddingCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K embedding tokens" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelProvider.json b/packages/spec/json-schema/ModelProvider.json new file mode 100644 index 0000000..6d0535e --- /dev/null +++ b/packages/spec/json-schema/ModelProvider.json @@ -0,0 +1,19 @@ +{ + "$ref": "#/definitions/ModelProvider", + "definitions": { + "ModelProvider": { + "type": "string", + "enum": [ + "openai", + "azure_openai", + "anthropic", + "google", + "cohere", + "huggingface", + "local", + "custom" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelRegistry.json b/packages/spec/json-schema/ModelRegistry.json new file mode 100644 index 0000000..1d1417b --- /dev/null +++ b/packages/spec/json-schema/ModelRegistry.json @@ -0,0 +1,427 @@ +{ + "$ref": "#/definitions/ModelRegistry", + "definitions": { + "ModelRegistry": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Registry name" + }, + "models": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "model": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique model identifier" + }, + "name": { + "type": "string", + "description": "Model display name" + }, + "version": { + "type": "string", + "description": "Model version (e.g., \"gpt-4-turbo-2024-04-09\")" + }, + "provider": { + "type": "string", + "enum": [ + "openai", + "azure_openai", + "anthropic", + "google", + "cohere", + "huggingface", + "local", + "custom" + ] + }, + "capabilities": { + "type": "object", + "properties": { + "textGeneration": { + "type": "boolean", + "default": true, + "description": "Supports text generation" + }, + "textEmbedding": { + "type": "boolean", + "default": false, + "description": "Supports text embedding" + }, + "imageGeneration": { + "type": "boolean", + "default": false, + "description": "Supports image generation" + }, + "imageUnderstanding": { + "type": "boolean", + "default": false, + "description": "Supports image understanding" + }, + "functionCalling": { + "type": "boolean", + "default": false, + "description": "Supports function calling" + }, + "codeGeneration": { + "type": "boolean", + "default": false, + "description": "Supports code generation" + }, + "reasoning": { + "type": "boolean", + "default": false, + "description": "Supports advanced reasoning" + } + }, + "additionalProperties": false + }, + "limits": { + "type": "object", + "properties": { + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per request" + }, + "contextWindow": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Context window size" + }, + "maxOutputTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum output tokens" + }, + "rateLimit": { + "type": "object", + "properties": { + "requestsPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "tokensPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + } + }, + "additionalProperties": false + } + }, + "required": [ + "maxTokens", + "contextWindow" + ], + "additionalProperties": false + }, + "pricing": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "default": "USD" + }, + "inputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K input tokens" + }, + "outputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K output tokens" + }, + "embeddingCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K embedding tokens" + } + }, + "additionalProperties": false + }, + "endpoint": { + "type": "string", + "format": "uri", + "description": "Custom API endpoint" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + }, + "region": { + "type": "string", + "description": "Deployment region (e.g., \"us-east-1\")" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags for categorization" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "recommendedFor": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Use case recommendations" + } + }, + "required": [ + "id", + "name", + "version", + "provider", + "capabilities", + "limits" + ], + "additionalProperties": false + }, + "status": { + "type": "string", + "enum": [ + "active", + "deprecated", + "experimental", + "disabled" + ], + "default": "active" + }, + "priority": { + "type": "integer", + "default": 0, + "description": "Priority for model selection" + }, + "fallbackModels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fallback model IDs" + }, + "healthCheck": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "intervalSeconds": { + "type": "integer", + "default": 300 + }, + "lastChecked": { + "type": "string", + "description": "ISO timestamp" + }, + "status": { + "type": "string", + "enum": [ + "healthy", + "unhealthy", + "unknown" + ], + "default": "unknown" + } + }, + "additionalProperties": false + } + }, + "required": [ + "model" + ], + "additionalProperties": false + }, + "description": "Model entries by ID" + }, + "promptTemplates": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique template identifier" + }, + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Template name (snake_case)" + }, + "label": { + "type": "string", + "description": "Display name" + }, + "system": { + "type": "string", + "description": "System prompt" + }, + "user": { + "type": "string", + "description": "User prompt template with variables" + }, + "assistant": { + "type": "string", + "description": "Assistant message prefix" + }, + "variables": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable name (e.g., \"user_name\", \"context\")" + }, + "type": { + "type": "string", + "enum": [ + "string", + "number", + "boolean", + "object", + "array" + ], + "default": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "defaultValue": {}, + "description": { + "type": "string" + }, + "validation": { + "type": "object", + "properties": { + "minLength": { + "type": "number" + }, + "maxLength": { + "type": "number" + }, + "pattern": { + "type": "string" + }, + "enum": { + "type": "array" + } + }, + "additionalProperties": false + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "description": "Template variables" + }, + "modelId": { + "type": "string", + "description": "Recommended model ID" + }, + "temperature": { + "type": "number", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number" + }, + "topP": { + "type": "number" + }, + "frequencyPenalty": { + "type": "number" + }, + "presencePenalty": { + "type": "number" + }, + "stopSequences": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "default": "1.0.0" + }, + "description": { + "type": "string" + }, + "category": { + "type": "string", + "description": "Template category (e.g., \"code_generation\", \"support\")" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "properties": { + "input": { + "type": "object", + "additionalProperties": {}, + "description": "Example variable values" + }, + "output": { + "type": "string", + "description": "Expected output" + } + }, + "required": [ + "input", + "output" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "name", + "label", + "user" + ], + "additionalProperties": false + }, + "description": "Prompt templates by name" + }, + "defaultModel": { + "type": "string", + "description": "Default model ID" + }, + "enableAutoFallback": { + "type": "boolean", + "default": true, + "description": "Auto-fallback on errors" + } + }, + "required": [ + "name", + "models" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelRegistryEntry.json b/packages/spec/json-schema/ModelRegistryEntry.json new file mode 100644 index 0000000..9d43bb9 --- /dev/null +++ b/packages/spec/json-schema/ModelRegistryEntry.json @@ -0,0 +1,239 @@ +{ + "$ref": "#/definitions/ModelRegistryEntry", + "definitions": { + "ModelRegistryEntry": { + "type": "object", + "properties": { + "model": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique model identifier" + }, + "name": { + "type": "string", + "description": "Model display name" + }, + "version": { + "type": "string", + "description": "Model version (e.g., \"gpt-4-turbo-2024-04-09\")" + }, + "provider": { + "type": "string", + "enum": [ + "openai", + "azure_openai", + "anthropic", + "google", + "cohere", + "huggingface", + "local", + "custom" + ] + }, + "capabilities": { + "type": "object", + "properties": { + "textGeneration": { + "type": "boolean", + "default": true, + "description": "Supports text generation" + }, + "textEmbedding": { + "type": "boolean", + "default": false, + "description": "Supports text embedding" + }, + "imageGeneration": { + "type": "boolean", + "default": false, + "description": "Supports image generation" + }, + "imageUnderstanding": { + "type": "boolean", + "default": false, + "description": "Supports image understanding" + }, + "functionCalling": { + "type": "boolean", + "default": false, + "description": "Supports function calling" + }, + "codeGeneration": { + "type": "boolean", + "default": false, + "description": "Supports code generation" + }, + "reasoning": { + "type": "boolean", + "default": false, + "description": "Supports advanced reasoning" + } + }, + "additionalProperties": false + }, + "limits": { + "type": "object", + "properties": { + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per request" + }, + "contextWindow": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Context window size" + }, + "maxOutputTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum output tokens" + }, + "rateLimit": { + "type": "object", + "properties": { + "requestsPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "tokensPerMinute": { + "type": "integer", + "exclusiveMinimum": 0 + } + }, + "additionalProperties": false + } + }, + "required": [ + "maxTokens", + "contextWindow" + ], + "additionalProperties": false + }, + "pricing": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "default": "USD" + }, + "inputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K input tokens" + }, + "outputCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K output tokens" + }, + "embeddingCostPer1kTokens": { + "type": "number", + "description": "Cost per 1K embedding tokens" + } + }, + "additionalProperties": false + }, + "endpoint": { + "type": "string", + "format": "uri", + "description": "Custom API endpoint" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + }, + "region": { + "type": "string", + "description": "Deployment region (e.g., \"us-east-1\")" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags for categorization" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "recommendedFor": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Use case recommendations" + } + }, + "required": [ + "id", + "name", + "version", + "provider", + "capabilities", + "limits" + ], + "additionalProperties": false + }, + "status": { + "type": "string", + "enum": [ + "active", + "deprecated", + "experimental", + "disabled" + ], + "default": "active" + }, + "priority": { + "type": "integer", + "default": 0, + "description": "Priority for model selection" + }, + "fallbackModels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Fallback model IDs" + }, + "healthCheck": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "intervalSeconds": { + "type": "integer", + "default": 300 + }, + "lastChecked": { + "type": "string", + "description": "ISO timestamp" + }, + "status": { + "type": "string", + "enum": [ + "healthy", + "unhealthy", + "unknown" + ], + "default": "unknown" + } + }, + "additionalProperties": false + } + }, + "required": [ + "model" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/ModelSelectionCriteria.json b/packages/spec/json-schema/ModelSelectionCriteria.json new file mode 100644 index 0000000..b044079 --- /dev/null +++ b/packages/spec/json-schema/ModelSelectionCriteria.json @@ -0,0 +1,50 @@ +{ + "$ref": "#/definitions/ModelSelectionCriteria", + "definitions": { + "ModelSelectionCriteria": { + "type": "object", + "properties": { + "capabilities": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Required capabilities" + }, + "maxCostPer1kTokens": { + "type": "number", + "description": "Maximum acceptable cost" + }, + "minContextWindow": { + "type": "number", + "description": "Minimum context window size" + }, + "provider": { + "type": "string", + "enum": [ + "openai", + "azure_openai", + "anthropic", + "google", + "cohere", + "huggingface", + "local", + "custom" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "excludeDeprecated": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQAnalytics.json b/packages/spec/json-schema/NLQAnalytics.json new file mode 100644 index 0000000..156dfa6 --- /dev/null +++ b/packages/spec/json-schema/NLQAnalytics.json @@ -0,0 +1,106 @@ +{ + "$ref": "#/definitions/NLQAnalytics", + "definitions": { + "NLQAnalytics": { + "type": "object", + "properties": { + "totalQueries": { + "type": "integer" + }, + "successfulQueries": { + "type": "integer" + }, + "failedQueries": { + "type": "integer" + }, + "averageConfidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "intentDistribution": { + "type": "object", + "additionalProperties": { + "type": "integer" + }, + "description": "Count by intent type" + }, + "topQueries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "averageConfidence": { + "type": "number" + } + }, + "required": [ + "query", + "count", + "averageConfidence" + ], + "additionalProperties": false + } + }, + "averageParseTime": { + "type": "number", + "description": "Average parse time in milliseconds" + }, + "averageExecutionTime": { + "type": "number" + }, + "lowConfidenceQueries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "confidence": { + "type": "number" + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "query", + "confidence", + "timestamp" + ], + "additionalProperties": false + } + }, + "startDate": { + "type": "string", + "description": "ISO timestamp" + }, + "endDate": { + "type": "string", + "description": "ISO timestamp" + } + }, + "required": [ + "totalQueries", + "successfulQueries", + "failedQueries", + "averageConfidence", + "intentDistribution", + "topQueries", + "averageParseTime", + "lowConfidenceQueries", + "startDate", + "endDate" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQFieldMapping.json b/packages/spec/json-schema/NLQFieldMapping.json new file mode 100644 index 0000000..1b8d106 --- /dev/null +++ b/packages/spec/json-schema/NLQFieldMapping.json @@ -0,0 +1,40 @@ +{ + "$ref": "#/definitions/NLQFieldMapping", + "definitions": { + "NLQFieldMapping": { + "type": "object", + "properties": { + "naturalLanguage": { + "type": "string", + "description": "NL field name (e.g., \"customer name\")" + }, + "objectField": { + "type": "string", + "description": "Actual field name (e.g., \"account.name\")" + }, + "object": { + "type": "string", + "description": "Object name" + }, + "field": { + "type": "string", + "description": "Field name" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "naturalLanguage", + "objectField", + "object", + "field", + "confidence" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQModelConfig.json b/packages/spec/json-schema/NLQModelConfig.json new file mode 100644 index 0000000..9b732b7 --- /dev/null +++ b/packages/spec/json-schema/NLQModelConfig.json @@ -0,0 +1,78 @@ +{ + "$ref": "#/definitions/NLQModelConfig", + "definitions": { + "NLQModelConfig": { + "type": "object", + "properties": { + "modelId": { + "type": "string", + "description": "Model from registry" + }, + "systemPrompt": { + "type": "string", + "description": "System prompt override" + }, + "includeSchema": { + "type": "boolean", + "default": true, + "description": "Include object schema in prompt" + }, + "includeExamples": { + "type": "boolean", + "default": true, + "description": "Include examples in prompt" + }, + "enableIntentDetection": { + "type": "boolean", + "default": true + }, + "intentThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.7 + }, + "enableEntityRecognition": { + "type": "boolean", + "default": true + }, + "entityRecognitionModel": { + "type": "string" + }, + "enableFuzzyMatching": { + "type": "boolean", + "default": true, + "description": "Fuzzy match field names" + }, + "fuzzyMatchThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.8 + }, + "enableTimeframeDetection": { + "type": "boolean", + "default": true + }, + "defaultTimeframe": { + "type": "string", + "description": "Default timeframe if not specified" + }, + "enableCaching": { + "type": "boolean", + "default": true + }, + "cacheTTL": { + "type": "integer", + "default": 3600, + "description": "Cache TTL in seconds" + } + }, + "required": [ + "modelId" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQParseResult.json b/packages/spec/json-schema/NLQParseResult.json new file mode 100644 index 0000000..f90108e --- /dev/null +++ b/packages/spec/json-schema/NLQParseResult.json @@ -0,0 +1,252 @@ +{ + "$ref": "#/definitions/NLQParseResult", + "definitions": { + "NLQParseResult": { + "type": "object", + "properties": { + "originalQuery": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + }, + "intentConfidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "entities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "object", + "field", + "value", + "operator", + "function", + "timeframe" + ] + }, + "text": { + "type": "string", + "description": "Original text from query" + }, + "value": { + "description": "Normalized value" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Confidence score" + }, + "span": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "description": "Character span in query" + } + }, + "required": [ + "type", + "text", + "confidence" + ], + "additionalProperties": false + } + }, + "targetObject": { + "type": "string", + "description": "Primary object to query" + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "naturalLanguage": { + "type": "string", + "description": "NL field name (e.g., \"customer name\")" + }, + "objectField": { + "type": "string", + "description": "Actual field name (e.g., \"account.name\")" + }, + "object": { + "type": "string", + "description": "Object name" + }, + "field": { + "type": "string", + "description": "Field name" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "naturalLanguage", + "objectField", + "object", + "field", + "confidence" + ], + "additionalProperties": false + } + }, + "timeframe": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "absolute", + "relative" + ] + }, + "start": { + "type": "string", + "description": "Start date (ISO format)" + }, + "end": { + "type": "string", + "description": "End date (ISO format)" + }, + "relative": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "value": { + "type": "integer" + }, + "direction": { + "type": "string", + "enum": [ + "past", + "future", + "current" + ], + "default": "past" + } + }, + "required": [ + "unit", + "value" + ], + "additionalProperties": false + }, + "text": { + "type": "string", + "description": "Original timeframe text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false + }, + "ast": { + "description": "Generated ObjectQL AST" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Overall confidence" + }, + "ambiguities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "suggestions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type", + "description" + ], + "additionalProperties": false + }, + "description": "Detected ambiguities requiring clarification" + }, + "alternatives": { + "type": "array", + "items": { + "type": "object", + "properties": { + "interpretation": { + "type": "string" + }, + "confidence": { + "type": "number" + }, + "ast": {} + }, + "required": [ + "interpretation", + "confidence" + ], + "additionalProperties": false + } + } + }, + "required": [ + "originalQuery", + "intent", + "intentConfidence", + "entities", + "confidence" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQRequest.json b/packages/spec/json-schema/NLQRequest.json new file mode 100644 index 0000000..68a5909 --- /dev/null +++ b/packages/spec/json-schema/NLQRequest.json @@ -0,0 +1,110 @@ +{ + "$ref": "#/definitions/NLQRequest", + "definitions": { + "NLQRequest": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Natural language query" + }, + "context": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "userRole": { + "type": "string" + }, + "currentObject": { + "type": "string", + "description": "Current object being viewed" + }, + "currentRecordId": { + "type": "string", + "description": "Current record ID" + }, + "conversationHistory": { + "type": "array", + "items": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "timestamp": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + } + }, + "required": [ + "query", + "timestamp" + ], + "additionalProperties": false + } + }, + "defaultLimit": { + "type": "integer", + "default": 100 + }, + "timezone": { + "type": "string", + "default": "UTC" + }, + "locale": { + "type": "string", + "default": "en-US" + } + }, + "additionalProperties": false + }, + "includeAlternatives": { + "type": "boolean", + "default": false, + "description": "Include alternative interpretations" + }, + "maxAlternatives": { + "type": "integer", + "default": 3 + }, + "minConfidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.5, + "description": "Minimum confidence threshold" + }, + "executeQuery": { + "type": "boolean", + "default": false, + "description": "Execute query and return results" + }, + "maxResults": { + "type": "integer", + "description": "Maximum results to return" + } + }, + "required": [ + "query" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQResponse.json b/packages/spec/json-schema/NLQResponse.json new file mode 100644 index 0000000..615a59f --- /dev/null +++ b/packages/spec/json-schema/NLQResponse.json @@ -0,0 +1,288 @@ +{ + "$ref": "#/definitions/NLQResponse", + "definitions": { + "NLQResponse": { + "type": "object", + "properties": { + "parseResult": { + "type": "object", + "properties": { + "originalQuery": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + }, + "intentConfidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "entities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "object", + "field", + "value", + "operator", + "function", + "timeframe" + ] + }, + "text": { + "type": "string", + "description": "Original text from query" + }, + "value": { + "description": "Normalized value" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Confidence score" + }, + "span": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "description": "Character span in query" + } + }, + "required": [ + "type", + "text", + "confidence" + ], + "additionalProperties": false + } + }, + "targetObject": { + "type": "string", + "description": "Primary object to query" + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "naturalLanguage": { + "type": "string", + "description": "NL field name (e.g., \"customer name\")" + }, + "objectField": { + "type": "string", + "description": "Actual field name (e.g., \"account.name\")" + }, + "object": { + "type": "string", + "description": "Object name" + }, + "field": { + "type": "string", + "description": "Field name" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + }, + "required": [ + "naturalLanguage", + "objectField", + "object", + "field", + "confidence" + ], + "additionalProperties": false + } + }, + "timeframe": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "absolute", + "relative" + ] + }, + "start": { + "type": "string", + "description": "Start date (ISO format)" + }, + "end": { + "type": "string", + "description": "End date (ISO format)" + }, + "relative": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "value": { + "type": "integer" + }, + "direction": { + "type": "string", + "enum": [ + "past", + "future", + "current" + ], + "default": "past" + } + }, + "required": [ + "unit", + "value" + ], + "additionalProperties": false + }, + "text": { + "type": "string", + "description": "Original timeframe text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false + }, + "ast": { + "description": "Generated ObjectQL AST" + }, + "confidence": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Overall confidence" + }, + "ambiguities": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "suggestions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type", + "description" + ], + "additionalProperties": false + }, + "description": "Detected ambiguities requiring clarification" + }, + "alternatives": { + "type": "array", + "items": { + "type": "object", + "properties": { + "interpretation": { + "type": "string" + }, + "confidence": { + "type": "number" + }, + "ast": {} + }, + "required": [ + "interpretation", + "confidence" + ], + "additionalProperties": false + } + } + }, + "required": [ + "originalQuery", + "intent", + "intentConfidence", + "entities", + "confidence" + ], + "additionalProperties": false + }, + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": {} + }, + "description": "Query results" + }, + "totalCount": { + "type": "integer" + }, + "executionTime": { + "type": "number", + "description": "Execution time in milliseconds" + }, + "needsClarification": { + "type": "boolean", + "description": "Whether query needs clarification" + }, + "suggestions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Query refinement suggestions" + } + }, + "required": [ + "parseResult", + "needsClarification" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/NLQTrainingExample.json b/packages/spec/json-schema/NLQTrainingExample.json new file mode 100644 index 0000000..2b6538b --- /dev/null +++ b/packages/spec/json-schema/NLQTrainingExample.json @@ -0,0 +1,120 @@ +{ + "$ref": "#/definitions/NLQTrainingExample", + "definitions": { + "NLQTrainingExample": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "Natural language query" + }, + "context": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "userRole": { + "type": "string" + }, + "currentObject": { + "type": "string", + "description": "Current object being viewed" + }, + "currentRecordId": { + "type": "string", + "description": "Current record ID" + }, + "conversationHistory": { + "type": "array", + "items": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "timestamp": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + } + }, + "required": [ + "query", + "timestamp" + ], + "additionalProperties": false + } + }, + "defaultLimit": { + "type": "integer", + "default": 100 + }, + "timezone": { + "type": "string", + "default": "UTC" + }, + "locale": { + "type": "string", + "default": "en-US" + } + }, + "additionalProperties": false + }, + "expectedIntent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + }, + "expectedObject": { + "type": "string" + }, + "expectedAST": { + "description": "Expected ObjectQL AST" + }, + "category": { + "type": "string", + "description": "Example category" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "notes": { + "type": "string" + } + }, + "required": [ + "query", + "expectedIntent" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/PromptTemplate.json b/packages/spec/json-schema/PromptTemplate.json new file mode 100644 index 0000000..1e45abf --- /dev/null +++ b/packages/spec/json-schema/PromptTemplate.json @@ -0,0 +1,163 @@ +{ + "$ref": "#/definitions/PromptTemplate", + "definitions": { + "PromptTemplate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique template identifier" + }, + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Template name (snake_case)" + }, + "label": { + "type": "string", + "description": "Display name" + }, + "system": { + "type": "string", + "description": "System prompt" + }, + "user": { + "type": "string", + "description": "User prompt template with variables" + }, + "assistant": { + "type": "string", + "description": "Assistant message prefix" + }, + "variables": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable name (e.g., \"user_name\", \"context\")" + }, + "type": { + "type": "string", + "enum": [ + "string", + "number", + "boolean", + "object", + "array" + ], + "default": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "defaultValue": {}, + "description": { + "type": "string" + }, + "validation": { + "type": "object", + "properties": { + "minLength": { + "type": "number" + }, + "maxLength": { + "type": "number" + }, + "pattern": { + "type": "string" + }, + "enum": { + "type": "array" + } + }, + "additionalProperties": false + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "description": "Template variables" + }, + "modelId": { + "type": "string", + "description": "Recommended model ID" + }, + "temperature": { + "type": "number", + "minimum": 0, + "maximum": 2 + }, + "maxTokens": { + "type": "number" + }, + "topP": { + "type": "number" + }, + "frequencyPenalty": { + "type": "number" + }, + "presencePenalty": { + "type": "number" + }, + "stopSequences": { + "type": "array", + "items": { + "type": "string" + } + }, + "version": { + "type": "string", + "default": "1.0.0" + }, + "description": { + "type": "string" + }, + "category": { + "type": "string", + "description": "Template category (e.g., \"code_generation\", \"support\")" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "properties": { + "input": { + "type": "object", + "additionalProperties": {}, + "description": "Example variable values" + }, + "output": { + "type": "string", + "description": "Expected output" + } + }, + "required": [ + "input", + "output" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "name", + "label", + "user" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/PromptVariable.json b/packages/spec/json-schema/PromptVariable.json new file mode 100644 index 0000000..d2158c6 --- /dev/null +++ b/packages/spec/json-schema/PromptVariable.json @@ -0,0 +1,56 @@ +{ + "$ref": "#/definitions/PromptVariable", + "definitions": { + "PromptVariable": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable name (e.g., \"user_name\", \"context\")" + }, + "type": { + "type": "string", + "enum": [ + "string", + "number", + "boolean", + "object", + "array" + ], + "default": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "defaultValue": {}, + "description": { + "type": "string" + }, + "validation": { + "type": "object", + "properties": { + "minLength": { + "type": "number" + }, + "maxLength": { + "type": "number" + }, + "pattern": { + "type": "string" + }, + "enum": { + "type": "array" + } + }, + "additionalProperties": false + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/QueryContext.json b/packages/spec/json-schema/QueryContext.json new file mode 100644 index 0000000..9ca8bdd --- /dev/null +++ b/packages/spec/json-schema/QueryContext.json @@ -0,0 +1,72 @@ +{ + "$ref": "#/definitions/QueryContext", + "definitions": { + "QueryContext": { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "userRole": { + "type": "string" + }, + "currentObject": { + "type": "string", + "description": "Current object being viewed" + }, + "currentRecordId": { + "type": "string", + "description": "Current record ID" + }, + "conversationHistory": { + "type": "array", + "items": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "timestamp": { + "type": "string" + }, + "intent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + } + }, + "required": [ + "query", + "timestamp" + ], + "additionalProperties": false + } + }, + "defaultLimit": { + "type": "integer", + "default": 100 + }, + "timezone": { + "type": "string", + "default": "UTC" + }, + "locale": { + "type": "string", + "default": "en-US" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/QueryIntent.json b/packages/spec/json-schema/QueryIntent.json new file mode 100644 index 0000000..e7b7e24 --- /dev/null +++ b/packages/spec/json-schema/QueryIntent.json @@ -0,0 +1,21 @@ +{ + "$ref": "#/definitions/QueryIntent", + "definitions": { + "QueryIntent": { + "type": "string", + "enum": [ + "select", + "aggregate", + "filter", + "sort", + "compare", + "trend", + "insight", + "create", + "update", + "delete" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/QueryTemplate.json b/packages/spec/json-schema/QueryTemplate.json new file mode 100644 index 0000000..d1f7f46 --- /dev/null +++ b/packages/spec/json-schema/QueryTemplate.json @@ -0,0 +1,81 @@ +{ + "$ref": "#/definitions/QueryTemplate", + "definitions": { + "QueryTemplate": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Template name (snake_case)" + }, + "label": { + "type": "string" + }, + "pattern": { + "type": "string", + "description": "Query pattern with placeholders" + }, + "variables": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "object", + "field", + "value", + "timeframe" + ] + }, + "required": { + "type": "boolean", + "default": false + } + }, + "required": [ + "name", + "type" + ], + "additionalProperties": false + } + }, + "astTemplate": { + "description": "AST template with variable placeholders" + }, + "category": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "name", + "label", + "pattern", + "variables" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RAGPipelineConfig.json b/packages/spec/json-schema/RAGPipelineConfig.json new file mode 100644 index 0000000..4d4f8d7 --- /dev/null +++ b/packages/spec/json-schema/RAGPipelineConfig.json @@ -0,0 +1,552 @@ +{ + "$ref": "#/definitions/RAGPipelineConfig", + "definitions": { + "RAGPipelineConfig": { + "type": "object", + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z_][a-z0-9_]*$", + "description": "Pipeline name (snake_case)" + }, + "label": { + "type": "string", + "description": "Display name" + }, + "description": { + "type": "string" + }, + "embedding": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "openai", + "cohere", + "huggingface", + "azure_openai", + "local", + "custom" + ] + }, + "model": { + "type": "string", + "description": "Model name (e.g., \"text-embedding-3-large\")" + }, + "dimensions": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Embedding vector dimensions" + }, + "maxTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Maximum tokens per embedding" + }, + "batchSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100, + "description": "Batch size for embedding" + }, + "endpoint": { + "type": "string", + "format": "uri", + "description": "Custom endpoint URL" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + } + }, + "required": [ + "provider", + "model", + "dimensions" + ], + "additionalProperties": false + }, + "vectorStore": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "pinecone", + "weaviate", + "qdrant", + "milvus", + "chroma", + "pgvector", + "redis", + "opensearch", + "elasticsearch", + "custom" + ] + }, + "indexName": { + "type": "string", + "description": "Index/collection name" + }, + "namespace": { + "type": "string", + "description": "Namespace for multi-tenancy" + }, + "host": { + "type": "string", + "description": "Vector store host" + }, + "port": { + "type": "integer", + "description": "Vector store port" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + }, + "dimensions": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Vector dimensions" + }, + "metric": { + "type": "string", + "enum": [ + "cosine", + "euclidean", + "dotproduct" + ], + "default": "cosine" + }, + "batchSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100 + }, + "connectionPoolSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 10 + }, + "timeout": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 30000, + "description": "Timeout in milliseconds" + } + }, + "required": [ + "provider", + "indexName", + "dimensions" + ], + "additionalProperties": false + }, + "chunking": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "chunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Fixed chunk size in tokens/chars" + }, + "chunkOverlap": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "Overlap between chunks" + }, + "unit": { + "type": "string", + "enum": [ + "tokens", + "characters" + ], + "default": "tokens" + } + }, + "required": [ + "type", + "chunkSize" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "semantic" + }, + "model": { + "type": "string", + "description": "Model for semantic chunking" + }, + "minChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100 + }, + "maxChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 1000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "recursive" + }, + "separators": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "\n\n", + "\n", + " ", + "" + ] + }, + "chunkSize": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "chunkOverlap": { + "type": "integer", + "minimum": 0, + "default": 0 + } + }, + "required": [ + "type", + "chunkSize" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "markdown" + }, + "maxChunkSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 1000 + }, + "respectHeaders": { + "type": "boolean", + "default": true, + "description": "Keep headers with content" + }, + "respectCodeBlocks": { + "type": "boolean", + "default": true, + "description": "Keep code blocks intact" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + ] + }, + "retrieval": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "similarity" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5, + "description": "Number of results to retrieve" + }, + "scoreThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Minimum similarity score" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "mmr" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "fetchK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 20, + "description": "Initial fetch size" + }, + "lambda": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.5, + "description": "Diversity vs relevance (0=diverse, 1=relevant)" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "hybrid" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "vectorWeight": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.7, + "description": "Weight for vector search" + }, + "keywordWeight": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.3, + "description": "Weight for keyword search" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "parent_document" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "retrieveParent": { + "type": "boolean", + "default": true, + "description": "Retrieve full parent document" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + ] + }, + "reranking": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "model": { + "type": "string", + "description": "Reranking model name" + }, + "provider": { + "type": "string", + "enum": [ + "cohere", + "huggingface", + "custom" + ] + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 3, + "description": "Final number of results after reranking" + } + }, + "additionalProperties": false + }, + "loaders": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "file", + "directory", + "url", + "api", + "database", + "custom" + ] + }, + "source": { + "type": "string", + "description": "Source path, URL, or identifier" + }, + "fileTypes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Accepted file extensions (e.g., [\".pdf\", \".md\"])" + }, + "recursive": { + "type": "boolean", + "default": false, + "description": "Process directories recursively" + }, + "maxFileSize": { + "type": "integer", + "description": "Maximum file size in bytes" + }, + "excludePatterns": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Patterns to exclude" + }, + "extractImages": { + "type": "boolean", + "default": false, + "description": "Extract text from images (OCR)" + }, + "extractTables": { + "type": "boolean", + "default": false, + "description": "Extract and format tables" + }, + "loaderConfig": { + "type": "object", + "additionalProperties": {}, + "description": "Custom loader-specific config" + } + }, + "required": [ + "type", + "source" + ], + "additionalProperties": false + }, + "description": "Document loaders" + }, + "maxContextTokens": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 4000, + "description": "Maximum tokens in context" + }, + "contextWindow": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "LLM context window size" + }, + "metadataFilters": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "type": [ + "string", + "number" + ] + } + } + ] + }, + "description": "Filters for retrieval (e.g., {category: \"docs\", status: \"published\"})" + }, + "enableCache": { + "type": "boolean", + "default": true + }, + "cacheTTL": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 3600, + "description": "Cache TTL in seconds" + }, + "cacheInvalidationStrategy": { + "type": "string", + "enum": [ + "time_based", + "manual", + "on_update" + ], + "default": "time_based" + } + }, + "required": [ + "name", + "label", + "embedding", + "vectorStore", + "chunking", + "retrieval" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RAGPipelineStatus.json b/packages/spec/json-schema/RAGPipelineStatus.json new file mode 100644 index 0000000..14a5ef4 --- /dev/null +++ b/packages/spec/json-schema/RAGPipelineStatus.json @@ -0,0 +1,66 @@ +{ + "$ref": "#/definitions/RAGPipelineStatus", + "definitions": { + "RAGPipelineStatus": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "active", + "indexing", + "error", + "disabled" + ] + }, + "documentsIndexed": { + "type": "integer", + "minimum": 0 + }, + "lastIndexed": { + "type": "string", + "description": "ISO timestamp" + }, + "errorMessage": { + "type": "string" + }, + "health": { + "type": "object", + "properties": { + "vectorStore": { + "type": "string", + "enum": [ + "healthy", + "unhealthy", + "unknown" + ] + }, + "embeddingService": { + "type": "string", + "enum": [ + "healthy", + "unhealthy", + "unknown" + ] + } + }, + "required": [ + "vectorStore", + "embeddingService" + ], + "additionalProperties": false + } + }, + "required": [ + "name", + "status", + "documentsIndexed" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RAGQueryRequest.json b/packages/spec/json-schema/RAGQueryRequest.json new file mode 100644 index 0000000..14c04f8 --- /dev/null +++ b/packages/spec/json-schema/RAGQueryRequest.json @@ -0,0 +1,64 @@ +{ + "$ref": "#/definitions/RAGQueryRequest", + "definitions": { + "RAGQueryRequest": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "User query" + }, + "pipelineName": { + "type": "string", + "description": "Pipeline to use" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0 + }, + "metadataFilters": { + "type": "object", + "additionalProperties": {} + }, + "conversationHistory": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant", + "system" + ] + }, + "content": { + "type": "string" + } + }, + "required": [ + "role", + "content" + ], + "additionalProperties": false + } + }, + "includeMetadata": { + "type": "boolean", + "default": true + }, + "includeSources": { + "type": "boolean", + "default": true + } + }, + "required": [ + "query", + "pipelineName" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RAGQueryResponse.json b/packages/spec/json-schema/RAGQueryResponse.json new file mode 100644 index 0000000..32c6e01 --- /dev/null +++ b/packages/spec/json-schema/RAGQueryResponse.json @@ -0,0 +1,108 @@ +{ + "$ref": "#/definitions/RAGQueryResponse", + "definitions": { + "RAGQueryResponse": { + "type": "object", + "properties": { + "query": { + "type": "string" + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "score": { + "type": "number" + }, + "metadata": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Document source (file path, URL, etc.)" + }, + "sourceType": { + "type": "string", + "enum": [ + "file", + "url", + "api", + "database", + "custom" + ] + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + }, + "createdAt": { + "type": "string", + "description": "ISO timestamp" + }, + "updatedAt": { + "type": "string", + "description": "ISO timestamp" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": "string" + }, + "language": { + "type": "string", + "description": "Document language (ISO 639-1 code)" + }, + "custom": { + "type": "object", + "additionalProperties": {}, + "description": "Custom metadata fields" + } + }, + "required": [ + "source" + ], + "additionalProperties": false + }, + "chunkId": { + "type": "string" + } + }, + "required": [ + "content", + "score" + ], + "additionalProperties": false + } + }, + "context": { + "type": "string", + "description": "Assembled context for LLM" + }, + "tokensUsed": { + "type": "integer" + }, + "retrievalTime": { + "type": "number", + "description": "Retrieval time in milliseconds" + } + }, + "required": [ + "query", + "results", + "context" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RerankingConfig.json b/packages/spec/json-schema/RerankingConfig.json new file mode 100644 index 0000000..79be86f --- /dev/null +++ b/packages/spec/json-schema/RerankingConfig.json @@ -0,0 +1,34 @@ +{ + "$ref": "#/definitions/RerankingConfig", + "definitions": { + "RerankingConfig": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "default": false + }, + "model": { + "type": "string", + "description": "Reranking model name" + }, + "provider": { + "type": "string", + "enum": [ + "cohere", + "huggingface", + "custom" + ] + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 3, + "description": "Final number of results after reranking" + } + }, + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/RetrievalStrategy.json b/packages/spec/json-schema/RetrievalStrategy.json new file mode 100644 index 0000000..36a72b8 --- /dev/null +++ b/packages/spec/json-schema/RetrievalStrategy.json @@ -0,0 +1,121 @@ +{ + "$ref": "#/definitions/RetrievalStrategy", + "definitions": { + "RetrievalStrategy": { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "similarity" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5, + "description": "Number of results to retrieve" + }, + "scoreThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Minimum similarity score" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "mmr" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "fetchK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 20, + "description": "Initial fetch size" + }, + "lambda": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.5, + "description": "Diversity vs relevance (0=diverse, 1=relevant)" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "hybrid" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "vectorWeight": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.7, + "description": "Weight for vector search" + }, + "keywordWeight": { + "type": "number", + "minimum": 0, + "maximum": 1, + "default": 0.3, + "description": "Weight for keyword search" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "parent_document" + }, + "topK": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 5 + }, + "retrieveParent": { + "type": "boolean", + "default": true, + "description": "Retrieve full parent document" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/Timeframe.json b/packages/spec/json-schema/Timeframe.json new file mode 100644 index 0000000..165d1bf --- /dev/null +++ b/packages/spec/json-schema/Timeframe.json @@ -0,0 +1,68 @@ +{ + "$ref": "#/definitions/Timeframe", + "definitions": { + "Timeframe": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "absolute", + "relative" + ] + }, + "start": { + "type": "string", + "description": "Start date (ISO format)" + }, + "end": { + "type": "string", + "description": "End date (ISO format)" + }, + "relative": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "enum": [ + "hour", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "value": { + "type": "integer" + }, + "direction": { + "type": "string", + "enum": [ + "past", + "future", + "current" + ], + "default": "past" + } + }, + "required": [ + "unit", + "value" + ], + "additionalProperties": false + }, + "text": { + "type": "string", + "description": "Original timeframe text" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/VectorStoreConfig.json b/packages/spec/json-schema/VectorStoreConfig.json new file mode 100644 index 0000000..8010a92 --- /dev/null +++ b/packages/spec/json-schema/VectorStoreConfig.json @@ -0,0 +1,82 @@ +{ + "$ref": "#/definitions/VectorStoreConfig", + "definitions": { + "VectorStoreConfig": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": [ + "pinecone", + "weaviate", + "qdrant", + "milvus", + "chroma", + "pgvector", + "redis", + "opensearch", + "elasticsearch", + "custom" + ] + }, + "indexName": { + "type": "string", + "description": "Index/collection name" + }, + "namespace": { + "type": "string", + "description": "Namespace for multi-tenancy" + }, + "host": { + "type": "string", + "description": "Vector store host" + }, + "port": { + "type": "integer", + "description": "Vector store port" + }, + "apiKey": { + "type": "string", + "description": "API key or reference to secret" + }, + "dimensions": { + "type": "integer", + "exclusiveMinimum": 0, + "description": "Vector dimensions" + }, + "metric": { + "type": "string", + "enum": [ + "cosine", + "euclidean", + "dotproduct" + ], + "default": "cosine" + }, + "batchSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 100 + }, + "connectionPoolSize": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 10 + }, + "timeout": { + "type": "integer", + "exclusiveMinimum": 0, + "default": 30000, + "description": "Timeout in milliseconds" + } + }, + "required": [ + "provider", + "indexName", + "dimensions" + ], + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/VectorStoreProvider.json b/packages/spec/json-schema/VectorStoreProvider.json new file mode 100644 index 0000000..d99c957 --- /dev/null +++ b/packages/spec/json-schema/VectorStoreProvider.json @@ -0,0 +1,21 @@ +{ + "$ref": "#/definitions/VectorStoreProvider", + "definitions": { + "VectorStoreProvider": { + "type": "string", + "enum": [ + "pinecone", + "weaviate", + "qdrant", + "milvus", + "chroma", + "pgvector", + "redis", + "opensearch", + "elasticsearch", + "custom" + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/packages/spec/src/ai/nlq.test.ts b/packages/spec/src/ai/nlq.test.ts index fbdfdd6..153869a 100644 --- a/packages/spec/src/ai/nlq.test.ts +++ b/packages/spec/src/ai/nlq.test.ts @@ -3,7 +3,7 @@ import { QueryIntentSchema, EntitySchema, TimeframeSchema, - FieldMappingSchema, + NLQFieldMappingSchema, QueryContextSchema, NLQParseResultSchema, NLQRequestSchema, @@ -76,7 +76,7 @@ describe('TimeframeSchema', () => { }); }); -describe('FieldMappingSchema', () => { +describe('NLQFieldMappingSchema', () => { it('should accept field mapping', () => { const mapping = { naturalLanguage: 'customer name', @@ -85,7 +85,7 @@ describe('FieldMappingSchema', () => { field: 'name', confidence: 0.92, }; - expect(() => FieldMappingSchema.parse(mapping)).not.toThrow(); + expect(() => NLQFieldMappingSchema.parse(mapping)).not.toThrow(); }); }); diff --git a/packages/spec/src/ai/nlq.zod.ts b/packages/spec/src/ai/nlq.zod.ts index e3a0fa9..4711ed6 100644 --- a/packages/spec/src/ai/nlq.zod.ts +++ b/packages/spec/src/ai/nlq.zod.ts @@ -50,9 +50,10 @@ export const TimeframeSchema = z.object({ }); /** - * Field Mapping + * NLQ Field Mapping + * Maps natural language field names to actual object fields */ -export const FieldMappingSchema = z.object({ +export const NLQFieldMappingSchema = z.object({ naturalLanguage: z.string().describe('NL field name (e.g., "customer name")'), objectField: z.string().describe('Actual field name (e.g., "account.name")'), object: z.string().describe('Object name'), @@ -101,7 +102,7 @@ export const NLQParseResultSchema = z.object({ /** Object & Field Resolution */ targetObject: z.string().optional().describe('Primary object to query'), - fields: z.array(FieldMappingSchema).optional(), + fields: z.array(NLQFieldMappingSchema).optional(), /** Temporal Information */ timeframe: TimeframeSchema.optional(), @@ -291,7 +292,7 @@ export const QueryTemplateSchema = z.object({ export type QueryIntent = z.infer; export type Entity = z.infer; export type Timeframe = z.infer; -export type FieldMapping = z.infer; +export type NLQFieldMapping = z.infer; export type QueryContext = z.infer; export type NLQParseResult = z.infer; export type NLQRequest = z.infer; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f413a8a..6f5dd68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,6 +98,40 @@ importers: specifier: 4.3.5 version: 4.3.5 + examples/ai-analyst: + dependencies: + '@objectstack/spec': + specifier: workspace:* + version: link:../../packages/spec + + examples/ai-codegen: + dependencies: + '@objectstack/spec': + specifier: workspace:* + version: link:../../packages/spec + + examples/ai-sales: + dependencies: + '@objectstack/spec': + specifier: workspace:* + version: link:../../packages/spec + + examples/ai-support: + dependencies: + '@objectstack/spec': + specifier: workspace:* + version: link:../../packages/spec + devDependencies: + '@types/node': + specifier: ^20.10.0 + version: 20.19.30 + tsx: + specifier: ^4.21.0 + version: 4.21.0 + typescript: + specifier: ^5.3.0 + version: 5.9.3 + examples/crm: dependencies: '@objectstack/spec': From bf09b4cd9b1f6f6925cf45d0223dbe83ef104880 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:37:20 +0000 Subject: [PATCH 7/8] fix: Make schema fields with defaults optional and fix AI example TypeScript errors Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- examples/ai-analyst/src/ai-config.d.ts | 14 + examples/ai-analyst/src/ai-config.d.ts.map | 1 + examples/ai-analyst/src/ai-config.js | 138 + examples/ai-analyst/tsconfig.json | 9 + examples/ai-codegen/src/ai-config.d.ts | 14 + examples/ai-codegen/src/ai-config.d.ts.map | 1 + examples/ai-codegen/src/ai-config.js | 165 + examples/ai-codegen/src/ai-config.ts | 12 +- examples/ai-codegen/tsconfig.json | 9 + examples/ai-sales/src/ai-config.d.ts | 14 + examples/ai-sales/src/ai-config.d.ts.map | 1 + examples/ai-sales/src/ai-config.js | 167 + examples/ai-sales/src/ai-config.ts | 12 + examples/ai-sales/tsconfig.json | 9 + examples/ai-support/src/ai-config.d.ts | 18 + examples/ai-support/src/ai-config.d.ts.map | 1 + examples/ai-support/src/ai-config.js | 258 + examples/ai-support/src/ai-config.ts | 16 + examples/ai-support/tsconfig.json | 9 + examples/crm/objectstack.config.d.ts | 7730 +++++++++++++++++ examples/crm/objectstack.config.d.ts.map | 1 + examples/crm/objectstack.config.js | 88 + .../crm/src/domains/crm/account.object.d.ts | 926 ++ .../src/domains/crm/account.object.d.ts.map | 1 + .../crm/src/domains/crm/account.object.js | 228 + examples/crm/src/domains/crm/case.object.d.ts | 1435 +++ .../crm/src/domains/crm/case.object.d.ts.map | 1 + examples/crm/src/domains/crm/case.object.js | 365 + .../crm/src/domains/crm/contact.object.d.ts | 1331 +++ .../src/domains/crm/contact.object.d.ts.map | 1 + .../crm/src/domains/crm/contact.object.js | 219 + examples/crm/src/domains/crm/lead.object.d.ts | 1503 ++++ .../crm/src/domains/crm/lead.object.d.ts.map | 1 + examples/crm/src/domains/crm/lead.object.js | 282 + .../src/domains/crm/opportunity.object.d.ts | 1126 +++ .../domains/crm/opportunity.object.d.ts.map | 1 + .../crm/src/domains/crm/opportunity.object.js | 334 + examples/crm/src/domains/crm/task.object.d.ts | 1291 +++ .../crm/src/domains/crm/task.object.d.ts.map | 1 + examples/crm/src/domains/crm/task.object.js | 330 + examples/crm/src/server/apis.d.ts | 33 + examples/crm/src/server/apis.d.ts.map | 1 + examples/crm/src/server/apis.js | 36 + examples/crm/src/server/index.d.ts | 2 + examples/crm/src/server/index.d.ts.map | 1 + examples/crm/src/server/index.js | 17 + examples/crm/src/ui/actions.d.ts | 254 + examples/crm/src/ui/actions.d.ts.map | 1 + examples/crm/src/ui/actions.js | 194 + examples/crm/src/ui/dashboards.d.ts | 70 + examples/crm/src/ui/dashboards.d.ts.map | 1 + examples/crm/src/ui/dashboards.js | 391 + examples/crm/src/ui/reports.d.ts | 252 + examples/crm/src/ui/reports.d.ts.map | 1 + examples/crm/src/ui/reports.js | 344 + examples/host/debug-registry.d.ts | 2 + examples/host/debug-registry.d.ts.map | 1 + examples/host/debug-registry.js | 32 + examples/host/src/index.d.ts | 2 + examples/host/src/index.d.ts.map | 1 + examples/host/src/index.js | 26 + examples/plugin-bi/objectstack.config.d.ts | 4 + .../plugin-bi/objectstack.config.d.ts.map | 1 + examples/plugin-bi/objectstack.config.js | 61 + examples/plugin-bi/src/index.d.ts | 11 + examples/plugin-bi/src/index.d.ts.map | 1 + examples/plugin-bi/src/index.js | 52 + examples/todo/objectstack.config.d.ts | 408 + examples/todo/objectstack.config.d.ts.map | 1 + examples/todo/objectstack.config.js | 44 + examples/todo/src/client-test.d.ts | 2 + examples/todo/src/client-test.d.ts.map | 1 + examples/todo/src/client-test.js | 68 + .../todo/src/domains/todo/task.object.d.ts | 370 + .../src/domains/todo/task.object.d.ts.map | 1 + examples/todo/src/domains/todo/task.object.js | 47 + packages/spec/src/ai/model-registry.zod.ts | 20 +- packages/spec/src/ai/rag-pipeline.zod.ts | 16 +- 78 files changed, 20814 insertions(+), 19 deletions(-) create mode 100644 examples/ai-analyst/src/ai-config.d.ts create mode 100644 examples/ai-analyst/src/ai-config.d.ts.map create mode 100644 examples/ai-analyst/src/ai-config.js create mode 100644 examples/ai-analyst/tsconfig.json create mode 100644 examples/ai-codegen/src/ai-config.d.ts create mode 100644 examples/ai-codegen/src/ai-config.d.ts.map create mode 100644 examples/ai-codegen/src/ai-config.js create mode 100644 examples/ai-codegen/tsconfig.json create mode 100644 examples/ai-sales/src/ai-config.d.ts create mode 100644 examples/ai-sales/src/ai-config.d.ts.map create mode 100644 examples/ai-sales/src/ai-config.js create mode 100644 examples/ai-sales/tsconfig.json create mode 100644 examples/ai-support/src/ai-config.d.ts create mode 100644 examples/ai-support/src/ai-config.d.ts.map create mode 100644 examples/ai-support/src/ai-config.js create mode 100644 examples/ai-support/tsconfig.json create mode 100644 examples/crm/objectstack.config.d.ts create mode 100644 examples/crm/objectstack.config.d.ts.map create mode 100644 examples/crm/objectstack.config.js create mode 100644 examples/crm/src/domains/crm/account.object.d.ts create mode 100644 examples/crm/src/domains/crm/account.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/account.object.js create mode 100644 examples/crm/src/domains/crm/case.object.d.ts create mode 100644 examples/crm/src/domains/crm/case.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/case.object.js create mode 100644 examples/crm/src/domains/crm/contact.object.d.ts create mode 100644 examples/crm/src/domains/crm/contact.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/contact.object.js create mode 100644 examples/crm/src/domains/crm/lead.object.d.ts create mode 100644 examples/crm/src/domains/crm/lead.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/lead.object.js create mode 100644 examples/crm/src/domains/crm/opportunity.object.d.ts create mode 100644 examples/crm/src/domains/crm/opportunity.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/opportunity.object.js create mode 100644 examples/crm/src/domains/crm/task.object.d.ts create mode 100644 examples/crm/src/domains/crm/task.object.d.ts.map create mode 100644 examples/crm/src/domains/crm/task.object.js create mode 100644 examples/crm/src/server/apis.d.ts create mode 100644 examples/crm/src/server/apis.d.ts.map create mode 100644 examples/crm/src/server/apis.js create mode 100644 examples/crm/src/server/index.d.ts create mode 100644 examples/crm/src/server/index.d.ts.map create mode 100644 examples/crm/src/server/index.js create mode 100644 examples/crm/src/ui/actions.d.ts create mode 100644 examples/crm/src/ui/actions.d.ts.map create mode 100644 examples/crm/src/ui/actions.js create mode 100644 examples/crm/src/ui/dashboards.d.ts create mode 100644 examples/crm/src/ui/dashboards.d.ts.map create mode 100644 examples/crm/src/ui/dashboards.js create mode 100644 examples/crm/src/ui/reports.d.ts create mode 100644 examples/crm/src/ui/reports.d.ts.map create mode 100644 examples/crm/src/ui/reports.js create mode 100644 examples/host/debug-registry.d.ts create mode 100644 examples/host/debug-registry.d.ts.map create mode 100644 examples/host/debug-registry.js create mode 100644 examples/host/src/index.d.ts create mode 100644 examples/host/src/index.d.ts.map create mode 100644 examples/host/src/index.js create mode 100644 examples/plugin-bi/objectstack.config.d.ts create mode 100644 examples/plugin-bi/objectstack.config.d.ts.map create mode 100644 examples/plugin-bi/objectstack.config.js create mode 100644 examples/plugin-bi/src/index.d.ts create mode 100644 examples/plugin-bi/src/index.d.ts.map create mode 100644 examples/plugin-bi/src/index.js create mode 100644 examples/todo/objectstack.config.d.ts create mode 100644 examples/todo/objectstack.config.d.ts.map create mode 100644 examples/todo/objectstack.config.js create mode 100644 examples/todo/src/client-test.d.ts create mode 100644 examples/todo/src/client-test.d.ts.map create mode 100644 examples/todo/src/client-test.js create mode 100644 examples/todo/src/domains/todo/task.object.d.ts create mode 100644 examples/todo/src/domains/todo/task.object.d.ts.map create mode 100644 examples/todo/src/domains/todo/task.object.js diff --git a/examples/ai-analyst/src/ai-config.d.ts b/examples/ai-analyst/src/ai-config.d.ts new file mode 100644 index 0000000..5fcb5be --- /dev/null +++ b/examples/ai-analyst/src/ai-config.d.ts @@ -0,0 +1,14 @@ +import type { Agent, NLQModelConfig, QueryTemplate } from '@objectstack/spec'; +/** + * AI Data Analyst Agent + */ +export declare const DataAnalystAgent: Agent; +/** + * NLQ Configuration for Business Intelligence + */ +export declare const AnalystNLQConfig: NLQModelConfig; +/** + * Common Query Templates + */ +export declare const AnalystQueryTemplates: QueryTemplate[]; +//# sourceMappingURL=ai-config.d.ts.map \ No newline at end of file diff --git a/examples/ai-analyst/src/ai-config.d.ts.map b/examples/ai-analyst/src/ai-config.d.ts.map new file mode 100644 index 0000000..cdd7e70 --- /dev/null +++ b/examples/ai-analyst/src/ai-config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["ai-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KA+C9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAkB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,EAiEhD,CAAC"} \ No newline at end of file diff --git a/examples/ai-analyst/src/ai-config.js b/examples/ai-analyst/src/ai-config.js new file mode 100644 index 0000000..2c07679 --- /dev/null +++ b/examples/ai-analyst/src/ai-config.js @@ -0,0 +1,138 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnalystQueryTemplates = exports.AnalystNLQConfig = exports.DataAnalystAgent = void 0; +/** + * AI Data Analyst Agent + */ +exports.DataAnalystAgent = { + name: 'data_analyst_ai', + label: 'AI Data Analyst', + role: 'Business Intelligence Analyst', + instructions: `You are a data analyst helping users understand their business metrics. + +Skills: +- Interpret natural language questions about data +- Generate ObjectQL queries +- Create visualizations +- Provide actionable insights + +Be precise, data-driven, and clear in explanations.`, + model: { + provider: 'openai', + model: 'gpt-4', + temperature: 0.3, + maxTokens: 4096, + }, + tools: [ + { + type: 'query', + name: 'execute_objectql', + description: 'Execute ObjectQL queries on data', + }, + { + type: 'action', + name: 'create_dashboard', + description: 'Generate dashboard from metrics', + }, + { + type: 'action', + name: 'generate_chart', + description: 'Create charts and visualizations', + }, + { + type: 'query', + name: 'get_schema', + description: 'Get object schema information', + }, + ], + access: ['analysts', 'executives', 'managers'], + active: true, +}; +/** + * NLQ Configuration for Business Intelligence + */ +exports.AnalystNLQConfig = { + modelId: 'gpt-4', + systemPrompt: `You are an expert at converting business questions into ObjectQL queries. + +Available objects: account, opportunity, task, product, order +Be precise with field names and support timeframes like "last quarter", "this year".`, + includeSchema: true, + includeExamples: true, + enableIntentDetection: true, + intentThreshold: 0.75, + enableEntityRecognition: true, + enableFuzzyMatching: true, + fuzzyMatchThreshold: 0.85, + enableTimeframeDetection: true, + defaultTimeframe: 'current_month', + enableCaching: true, + cacheTTL: 3600, +}; +/** + * Common Query Templates + */ +exports.AnalystQueryTemplates = [ + { + id: 'top-n-by-field', + name: 'top_n_by_field', + label: 'Top N Records by Field', + pattern: 'top {n} {object} by {field}', + variables: [ + { name: 'n', type: 'value', required: true }, + { name: 'object', type: 'object', required: true }, + { name: 'field', type: 'field', required: true }, + ], + astTemplate: { + object: '{object}', + sort: [{ field: '{field}', order: 'desc' }], + limit: '{n}', + }, + category: 'ranking', + examples: [ + 'top 10 accounts by revenue', + 'top 5 products by sales', + ], + }, + { + id: 'aggregate-by-group', + name: 'aggregate_by_group', + label: 'Aggregate by Group', + pattern: 'total {field} by {group_field}', + variables: [ + { name: 'field', type: 'field', required: true }, + { name: 'group_field', type: 'field', required: true }, + ], + astTemplate: { + fields: [ + '{group_field}', + { function: 'sum', field: '{field}', alias: 'total' }, + ], + groupBy: ['{group_field}'], + }, + category: 'aggregation', + examples: [ + 'total revenue by region', + 'total orders by product', + ], + }, + { + id: 'time-comparison', + name: 'time_comparison', + label: 'Time Period Comparison', + pattern: 'compare {metric} for {period1} vs {period2}', + variables: [ + { name: 'metric', type: 'field', required: true }, + { name: 'period1', type: 'timeframe', required: true }, + { name: 'period2', type: 'timeframe', required: true }, + ], + astTemplate: { + // Complex comparison logic + }, + category: 'comparison', + examples: [ + 'compare revenue for this month vs last month', + 'compare sales for Q1 vs Q2', + ], + }, +]; diff --git a/examples/ai-analyst/tsconfig.json b/examples/ai-analyst/tsconfig.json new file mode 100644 index 0000000..8d55dc9 --- /dev/null +++ b/examples/ai-analyst/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/ai-codegen/src/ai-config.d.ts b/examples/ai-codegen/src/ai-config.d.ts new file mode 100644 index 0000000..a316695 --- /dev/null +++ b/examples/ai-codegen/src/ai-config.d.ts @@ -0,0 +1,14 @@ +import type { Agent, ModelRegistry, RAGPipelineConfig } from '@objectstack/spec'; +/** + * ObjectStack Code Generator Agent + */ +export declare const CodeGenAgent: Agent; +/** + * Code Generation Model Registry + */ +export declare const CodeGenModelRegistry: ModelRegistry; +/** + * RAG for ObjectStack Documentation + */ +export declare const ObjectStackDocsRAG: RAGPipelineConfig; +//# sourceMappingURL=ai-config.d.ts.map \ No newline at end of file diff --git a/examples/ai-codegen/src/ai-config.d.ts.map b/examples/ai-codegen/src/ai-config.d.ts.map new file mode 100644 index 0000000..847333b --- /dev/null +++ b/examples/ai-codegen/src/ai-config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["ai-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KA8D1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aA+DlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAsChC,CAAC"} \ No newline at end of file diff --git a/examples/ai-codegen/src/ai-config.js b/examples/ai-codegen/src/ai-config.js new file mode 100644 index 0000000..c653dcb --- /dev/null +++ b/examples/ai-codegen/src/ai-config.js @@ -0,0 +1,165 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ObjectStackDocsRAG = exports.CodeGenModelRegistry = exports.CodeGenAgent = void 0; +/** + * ObjectStack Code Generator Agent + */ +exports.CodeGenAgent = { + name: 'objectstack_code_generator', + label: 'ObjectStack Code Generator', + role: 'Senior ObjectStack Developer', + instructions: `You are an expert ObjectStack developer who generates high-quality applications. + +Rules: +1. Follow ObjectStack naming conventions (camelCase for props, snake_case for names) +2. Generate complete, production-ready code +3. Include validation rules and indexes +4. Create appropriate views and forms +5. Follow best practices from the knowledge base + +Always validate generated code before returning.`, + model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.3, + maxTokens: 8192, + }, + tools: [ + { + type: 'action', + name: 'generate_object', + description: 'Generate ObjectStack object definition', + }, + { + type: 'action', + name: 'generate_field', + description: 'Generate field definition', + }, + { + type: 'action', + name: 'generate_view', + description: 'Generate view configuration', + }, + { + type: 'action', + name: 'validate_schema', + description: 'Validate generated schema', + }, + { + type: 'vector_search', + name: 'search_examples', + description: 'Search example applications', + }, + ], + knowledge: { + topics: [ + 'objectstack_protocol', + 'best_practices', + 'code_examples', + 'design_patterns', + ], + indexes: ['objectstack_knowledge'], + }, + active: true, +}; +/** + * Code Generation Model Registry + */ +exports.CodeGenModelRegistry = { + name: 'code_generation_registry', + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, + codeGeneration: true, + reasoning: true, + }, + limits: { + maxTokens: 8192, + contextWindow: 128000, + }, + recommendedFor: ['code_generation', 'complex_reasoning'], + deprecated: false, + }, + status: 'active', + priority: 10, + }, + }, + promptTemplates: { + object_generator: { + id: 'object-gen-v1', + name: 'object_generator', + label: 'Object Generator', + version: '1.0.0', + system: `You are an expert at generating ObjectStack object definitions. + +Generate valid TypeScript code following ObjectStack Protocol. +Use camelCase for configuration properties, snake_case for name identifiers.`, + user: `Generate an ObjectStack object for: {{description}} + +Requirements: +{{requirements}} + +Include: +- Field definitions with proper types +- Validation rules if needed +- Indexes for performance +- Enable appropriate features`, + variables: [ + { name: 'description', type: 'string', required: true }, + { name: 'requirements', type: 'string', required: false }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.3, + category: 'code_generation', + }, + }, + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, +}; +/** + * RAG for ObjectStack Documentation + */ +exports.ObjectStackDocsRAG = { + name: 'objectstack_documentation', + label: 'ObjectStack Documentation RAG', + description: 'RAG pipeline for ObjectStack protocol docs and examples', + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + batchSize: 100, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'objectstack-docs', + dimensions: 3072, + metric: 'cosine', + batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, + }, + chunking: { + type: 'markdown', + maxChunkSize: 1500, + respectHeaders: true, + respectCodeBlocks: true, + }, + retrieval: { + type: 'similarity', + topK: 5, + scoreThreshold: 0.7, + }, + maxContextTokens: 8000, + enableCache: true, + cacheTTL: 7200, +}; diff --git a/examples/ai-codegen/src/ai-config.ts b/examples/ai-codegen/src/ai-config.ts index 77e95c2..393d74f 100644 --- a/examples/ai-codegen/src/ai-config.ts +++ b/examples/ai-codegen/src/ai-config.ts @@ -1,4 +1,4 @@ -import type { Agent, ModelRegistry, PromptTemplate, RAGPipelineConfig } from '@objectstack/spec'; +import type { Agent, ModelRegistry, RAGPipelineConfig } from '@objectstack/spec'; /** * ObjectStack Code Generator Agent @@ -82,6 +82,10 @@ export const CodeGenModelRegistry: ModelRegistry = { provider: 'openai', capabilities: { textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, codeGeneration: true, reasoning: true, }, @@ -90,6 +94,7 @@ export const CodeGenModelRegistry: ModelRegistry = { contextWindow: 128000, }, recommendedFor: ['code_generation', 'complex_reasoning'], + deprecated: false, }, status: 'active', priority: 10, @@ -101,6 +106,7 @@ export const CodeGenModelRegistry: ModelRegistry = { id: 'object-gen-v1', name: 'object_generator', label: 'Object Generator', + version: '1.0.0', system: `You are an expert at generating ObjectStack object definitions. Generate valid TypeScript code following ObjectStack Protocol. @@ -141,6 +147,7 @@ export const ObjectStackDocsRAG: RAGPipelineConfig = { provider: 'openai', model: 'text-embedding-3-large', dimensions: 3072, + batchSize: 100, }, vectorStore: { @@ -148,6 +155,9 @@ export const ObjectStackDocsRAG: RAGPipelineConfig = { indexName: 'objectstack-docs', dimensions: 3072, metric: 'cosine', + batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, }, chunking: { diff --git a/examples/ai-codegen/tsconfig.json b/examples/ai-codegen/tsconfig.json new file mode 100644 index 0000000..8d55dc9 --- /dev/null +++ b/examples/ai-codegen/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/ai-sales/src/ai-config.d.ts b/examples/ai-sales/src/ai-config.d.ts new file mode 100644 index 0000000..b6dcb56 --- /dev/null +++ b/examples/ai-sales/src/ai-config.d.ts @@ -0,0 +1,14 @@ +import type { Agent, ModelRegistry, RAGPipelineConfig } from '@objectstack/spec'; +/** + * AI Sales Assistant Agent + */ +export declare const SalesAgent: Agent; +/** + * Sales Model Registry + */ +export declare const SalesModelRegistry: ModelRegistry; +/** + * Sales Intelligence RAG + */ +export declare const SalesIntelligenceRAG: RAGPipelineConfig; +//# sourceMappingURL=ai-config.d.ts.map \ No newline at end of file diff --git a/examples/ai-sales/src/ai-config.d.ts.map b/examples/ai-sales/src/ai-config.d.ts.map new file mode 100644 index 0000000..7525b44 --- /dev/null +++ b/examples/ai-sales/src/ai-config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["ai-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAyDxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAqEhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,iBAuClC,CAAC"} \ No newline at end of file diff --git a/examples/ai-sales/src/ai-config.js b/examples/ai-sales/src/ai-config.js new file mode 100644 index 0000000..0c6c066 --- /dev/null +++ b/examples/ai-sales/src/ai-config.js @@ -0,0 +1,167 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SalesIntelligenceRAG = exports.SalesModelRegistry = exports.SalesAgent = void 0; +/** + * AI Sales Assistant Agent + */ +exports.SalesAgent = { + name: 'sales_assistant_ai', + label: 'AI Sales Assistant', + role: 'Sales Development Representative', + instructions: `You are a sales assistant helping SDRs close deals. + +Core capabilities: +- Research accounts and contacts +- Draft personalized outreach emails +- Update opportunity information +- Provide competitive intelligence +- Schedule follow-ups + +Be persuasive but honest. Focus on value creation.`, + model: { + provider: 'anthropic', + model: 'claude-3-sonnet-20240229', + temperature: 0.8, + }, + tools: [ + { + type: 'query', + name: 'get_account_info', + description: 'Retrieve account and contact details', + }, + { + type: 'action', + name: 'update_opportunity', + description: 'Update opportunity fields and stage', + }, + { + type: 'action', + name: 'send_email', + description: 'Send personalized email via template', + }, + { + type: 'flow', + name: 'create_follow_up_task', + description: 'Schedule follow-up activity', + }, + { + type: 'vector_search', + name: 'search_case_studies', + description: 'Find relevant customer success stories', + }, + ], + knowledge: { + topics: ['sales_playbooks', 'product_features', 'case_studies', 'competitor_analysis'], + indexes: ['sales_intelligence'], + }, + access: ['sales_team'], + active: true, +}; +/** + * Sales Model Registry + */ +exports.SalesModelRegistry = { + name: 'sales_ai_registry', + models: { + 'claude-3-sonnet': { + model: { + id: 'claude-3-sonnet', + name: 'Claude 3 Sonnet', + version: 'claude-3-sonnet-20240229', + provider: 'anthropic', + capabilities: { + textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, + codeGeneration: false, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 200000, + }, + pricing: { + currency: 'USD', + inputCostPer1kTokens: 0.003, + outputCostPer1kTokens: 0.015, + }, + recommendedFor: ['creative_writing', 'personalization'], + deprecated: false, + }, + status: 'active', + priority: 10, + }, + }, + promptTemplates: { + personalized_email: { + id: 'email-v1', + name: 'personalized_email', + label: 'Personalized Sales Email', + version: '1.0.0', + system: 'You are an expert sales writer. Create compelling, personalized emails.', + user: `Write a personalized email to: +Company: {{company_name}} +Contact: {{contact_name}} +Title: {{contact_title}} +Industry: {{industry}} + +Objective: {{objective}} +Value Proposition: {{value_prop}} + +Tone: Professional but friendly. Max 150 words.`, + variables: [ + { name: 'company_name', type: 'string', required: true }, + { name: 'contact_name', type: 'string', required: true }, + { name: 'contact_title', type: 'string', required: false }, + { name: 'industry', type: 'string', required: false }, + { name: 'objective', type: 'string', required: true }, + { name: 'value_prop', type: 'string', required: true }, + ], + modelId: 'claude-3-sonnet', + temperature: 0.8, + category: 'sales_outreach', + }, + }, + defaultModel: 'claude-3-sonnet', + enableAutoFallback: true, +}; +/** + * Sales Intelligence RAG + */ +exports.SalesIntelligenceRAG = { + name: 'sales_intelligence', + label: 'Sales Intelligence', + description: 'RAG pipeline for sales playbooks, case studies, and competitive intel', + embedding: { + provider: 'openai', + model: 'text-embedding-3-small', + dimensions: 1536, + batchSize: 100, + }, + vectorStore: { + provider: 'weaviate', + indexName: 'SalesIntelligence', + dimensions: 1536, + metric: 'cosine', + batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, + }, + chunking: { + type: 'recursive', + separators: ['\n\n', '\n', '. ', ' '], + chunkSize: 800, + chunkOverlap: 100, + }, + retrieval: { + type: 'hybrid', + topK: 8, + vectorWeight: 0.7, + keywordWeight: 0.3, + }, + maxContextTokens: 4000, + enableCache: true, + cacheTTL: 3600, +}; diff --git a/examples/ai-sales/src/ai-config.ts b/examples/ai-sales/src/ai-config.ts index c447eb7..096ae59 100644 --- a/examples/ai-sales/src/ai-config.ts +++ b/examples/ai-sales/src/ai-config.ts @@ -77,6 +77,11 @@ export const SalesModelRegistry: ModelRegistry = { provider: 'anthropic', capabilities: { textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, + codeGeneration: false, reasoning: true, }, limits: { @@ -84,10 +89,12 @@ export const SalesModelRegistry: ModelRegistry = { contextWindow: 200000, }, pricing: { + currency: 'USD', inputCostPer1kTokens: 0.003, outputCostPer1kTokens: 0.015, }, recommendedFor: ['creative_writing', 'personalization'], + deprecated: false, }, status: 'active', priority: 10, @@ -99,6 +106,7 @@ export const SalesModelRegistry: ModelRegistry = { id: 'email-v1', name: 'personalized_email', label: 'Personalized Sales Email', + version: '1.0.0', system: 'You are an expert sales writer. Create compelling, personalized emails.', user: `Write a personalized email to: Company: {{company_name}} @@ -140,6 +148,7 @@ export const SalesIntelligenceRAG: RAGPipelineConfig = { provider: 'openai', model: 'text-embedding-3-small', dimensions: 1536, + batchSize: 100, }, vectorStore: { @@ -147,6 +156,9 @@ export const SalesIntelligenceRAG: RAGPipelineConfig = { indexName: 'SalesIntelligence', dimensions: 1536, metric: 'cosine', + batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, }, chunking: { diff --git a/examples/ai-sales/tsconfig.json b/examples/ai-sales/tsconfig.json new file mode 100644 index 0000000..8d55dc9 --- /dev/null +++ b/examples/ai-sales/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/ai-support/src/ai-config.d.ts b/examples/ai-support/src/ai-config.d.ts new file mode 100644 index 0000000..156d6ff --- /dev/null +++ b/examples/ai-support/src/ai-config.d.ts @@ -0,0 +1,18 @@ +import type { Agent, ModelRegistry, RAGPipelineConfig, FieldSynonymConfig } from '@objectstack/spec'; +/** + * AI Support Assistant - Agent Configuration + */ +export declare const SupportAgent: Agent; +/** + * Model Registry for AI Support + */ +export declare const SupportModelRegistry: ModelRegistry; +/** + * RAG Pipeline for Knowledge Base + */ +export declare const KnowledgeBaseRAG: RAGPipelineConfig; +/** + * Field Synonyms for Natural Language Queries + */ +export declare const SupportFieldSynonyms: FieldSynonymConfig[]; +//# sourceMappingURL=ai-config.d.ts.map \ No newline at end of file diff --git a/examples/ai-support/src/ai-config.d.ts.map b/examples/ai-support/src/ai-config.d.ts.map new file mode 100644 index 0000000..1de5126 --- /dev/null +++ b/examples/ai-support/src/ai-config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["ai-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAuE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAoGlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAmE9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,EAmBpD,CAAC"} \ No newline at end of file diff --git a/examples/ai-support/src/ai-config.js b/examples/ai-support/src/ai-config.js new file mode 100644 index 0000000..4be7bbd --- /dev/null +++ b/examples/ai-support/src/ai-config.js @@ -0,0 +1,258 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportFieldSynonyms = exports.KnowledgeBaseRAG = exports.SupportModelRegistry = exports.SupportAgent = void 0; +/** + * AI Support Assistant - Agent Configuration + */ +exports.SupportAgent = { + name: 'customer_support_ai', + label: 'AI Support Agent', + avatar: '/avatars/support-bot.png', + role: 'Senior Customer Support Specialist', + instructions: `You are an experienced customer support agent for ObjectStack. + +Your responsibilities: +- Answer customer questions professionally and accurately +- Search the knowledge base for solutions +- Create support tickets when needed +- Escalate complex issues to human agents +- Track customer satisfaction + +Always be polite, empathetic, and solution-oriented. If you don't know something, say so and offer to escalate.`, + model: { + provider: 'openai', + model: 'gpt-4-turbo-preview', + temperature: 0.7, + maxTokens: 2048, + }, + tools: [ + { + type: 'action', + name: 'create_support_ticket', + description: 'Create a new support ticket for the customer', + }, + { + type: 'action', + name: 'escalate_to_human', + description: 'Transfer conversation to a human agent', + }, + { + type: 'query', + name: 'search_tickets', + description: 'Search existing support tickets for similar issues', + }, + { + type: 'vector_search', + name: 'kb_search', + description: 'Search the knowledge base for relevant documentation', + }, + { + type: 'action', + name: 'update_ticket_status', + description: 'Update the status of a support ticket', + }, + { + type: 'flow', + name: 'collect_customer_feedback', + description: 'Collect customer satisfaction feedback', + }, + ], + knowledge: { + topics: [ + 'product_documentation', + 'troubleshooting_guides', + 'faq', + 'api_reference', + 'best_practices', + 'release_notes', + ], + indexes: ['support_kb_v2'], + }, + access: ['support_team', 'customers'], + active: true, +}; +/** + * Model Registry for AI Support + */ +exports.SupportModelRegistry = { + name: 'ai_support_registry', + models: { + 'gpt-4-turbo': { + model: { + id: 'gpt-4-turbo', + name: 'GPT-4 Turbo', + version: 'gpt-4-turbo-2024-04-09', + provider: 'openai', + capabilities: { + textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: true, + codeGeneration: false, + reasoning: true, + }, + limits: { + maxTokens: 4096, + contextWindow: 128000, + rateLimit: { + requestsPerMinute: 100, + }, + }, + pricing: { + currency: 'USD', + inputCostPer1kTokens: 0.01, + outputCostPer1kTokens: 0.03, + }, + tags: ['chat', 'support'], + deprecated: false, + }, + status: 'active', + priority: 10, + fallbackModels: ['gpt-3.5-turbo'], + healthCheck: { + enabled: true, + intervalSeconds: 300, + status: 'healthy', + }, + }, + 'text-embedding-3-large': { + model: { + id: 'text-embedding-3-large', + name: 'Text Embedding 3 Large', + version: 'text-embedding-3-large', + provider: 'openai', + capabilities: { + textGeneration: false, + textEmbedding: true, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, + codeGeneration: false, + reasoning: false, + }, + limits: { + maxTokens: 8191, + contextWindow: 8191, + }, + pricing: { + currency: 'USD', + embeddingCostPer1kTokens: 0.00013, + }, + tags: ['embedding', 'rag'], + deprecated: false, + }, + status: 'active', + priority: 10, + }, + }, + promptTemplates: { + support_response: { + id: 'support-response-v1', + name: 'support_response', + label: 'Support Response Template', + version: '1.0.0', + system: 'You are a helpful customer support agent. Be empathetic and solution-oriented.', + user: `Customer: {{customer_name}} +Question: {{question}} +Knowledge Base Context: {{kb_context}} + +Provide a helpful, professional response.`, + variables: [ + { name: 'customer_name', type: 'string', required: true }, + { name: 'question', type: 'string', required: true }, + { name: 'kb_context', type: 'string', required: false }, + ], + modelId: 'gpt-4-turbo', + temperature: 0.7, + category: 'support', + }, + }, + defaultModel: 'gpt-4-turbo', + enableAutoFallback: true, +}; +/** + * RAG Pipeline for Knowledge Base + */ +exports.KnowledgeBaseRAG = { + name: 'support_knowledge_base', + label: 'Customer Support Knowledge Base', + description: 'RAG pipeline for customer support documentation, FAQs, and troubleshooting guides', + embedding: { + provider: 'openai', + model: 'text-embedding-3-large', + dimensions: 3072, + batchSize: 100, + }, + vectorStore: { + provider: 'pinecone', + indexName: 'support-kb-prod', + namespace: 'v2', + dimensions: 3072, + metric: 'cosine', + batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, + }, + chunking: { + type: 'markdown', + maxChunkSize: 1000, + respectHeaders: true, + respectCodeBlocks: true, + }, + retrieval: { + type: 'mmr', + topK: 5, + fetchK: 20, + lambda: 0.7, + }, + reranking: { + enabled: true, + model: 'rerank-english-v3.0', + provider: 'cohere', + topK: 3, + }, + loaders: [ + { + type: 'directory', + source: '/knowledge-base/docs', + fileTypes: ['.md', '.txt', '.pdf'], + recursive: true, + maxFileSize: 5242880, // 5MB + excludePatterns: ['**/archive/**', '**/drafts/**'], + extractImages: false, + extractTables: true, + }, + ], + maxContextTokens: 6000, + contextWindow: 128000, + metadataFilters: { + status: 'published', + language: 'en', + }, + enableCache: true, + cacheTTL: 3600, +}; +/** + * Field Synonyms for Natural Language Queries + */ +exports.SupportFieldSynonyms = [ + { + object: 'support_ticket', + field: 'status', + synonyms: ['state', 'current status', 'ticket status', 'situation'], + examples: [ + 'show open tickets', + 'what is the current status of my ticket', + ], + }, + { + object: 'support_ticket', + field: 'priority', + synonyms: ['urgency', 'importance', 'severity'], + examples: [ + 'show high priority tickets', + 'urgent cases', + ], + }, +]; diff --git a/examples/ai-support/src/ai-config.ts b/examples/ai-support/src/ai-config.ts index 5c281fb..d2d2af6 100644 --- a/examples/ai-support/src/ai-config.ts +++ b/examples/ai-support/src/ai-config.ts @@ -96,6 +96,9 @@ export const SupportModelRegistry: ModelRegistry = { provider: 'openai', capabilities: { textGeneration: true, + textEmbedding: false, + imageGeneration: false, + imageUnderstanding: false, functionCalling: true, codeGeneration: false, reasoning: true, @@ -108,10 +111,12 @@ export const SupportModelRegistry: ModelRegistry = { }, }, pricing: { + currency: 'USD', inputCostPer1kTokens: 0.01, outputCostPer1kTokens: 0.03, }, tags: ['chat', 'support'], + deprecated: false, }, status: 'active', priority: 10, @@ -132,15 +137,22 @@ export const SupportModelRegistry: ModelRegistry = { capabilities: { textGeneration: false, textEmbedding: true, + imageGeneration: false, + imageUnderstanding: false, + functionCalling: false, + codeGeneration: false, + reasoning: false, }, limits: { maxTokens: 8191, contextWindow: 8191, }, pricing: { + currency: 'USD', embeddingCostPer1kTokens: 0.00013, }, tags: ['embedding', 'rag'], + deprecated: false, }, status: 'active', priority: 10, @@ -152,6 +164,7 @@ export const SupportModelRegistry: ModelRegistry = { id: 'support-response-v1', name: 'support_response', label: 'Support Response Template', + version: '1.0.0', system: 'You are a helpful customer support agent. Be empathetic and solution-oriented.', user: `Customer: {{customer_name}} Question: {{question}} @@ -195,6 +208,8 @@ export const KnowledgeBaseRAG: RAGPipelineConfig = { dimensions: 3072, metric: 'cosine', batchSize: 100, + connectionPoolSize: 10, + timeout: 30000, }, chunking: { @@ -226,6 +241,7 @@ export const KnowledgeBaseRAG: RAGPipelineConfig = { recursive: true, maxFileSize: 5242880, // 5MB excludePatterns: ['**/archive/**', '**/drafts/**'], + extractImages: false, extractTables: true, }, ], diff --git a/examples/ai-support/tsconfig.json b/examples/ai-support/tsconfig.json new file mode 100644 index 0000000..8d55dc9 --- /dev/null +++ b/examples/ai-support/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/examples/crm/objectstack.config.d.ts b/examples/crm/objectstack.config.d.ts new file mode 100644 index 0000000..98e9350 --- /dev/null +++ b/examples/crm/objectstack.config.d.ts @@ -0,0 +1,7730 @@ +declare const _default: { + name: string; + label: string; + description: string; + version: string; + icon: string; + objects: ({ + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + nameField: string; + fields: { + account_number: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "autonumber"; + }; + name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + industry: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + annual_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + number_of_employees: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + website: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "url"; + }; + billing_address: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "address"; + }; + office_location: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "location"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + parent_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_active: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + last_activity_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + brand_color: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "color"; + }; + }; + indexes: { + fields: string[]; + unique: false; + }[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + apiMethods: ("get" | "list" | "create" | "update" | "delete" | "search" | "export")[]; + files: true; + feedEnabled: true; + trash: true; + }; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_accounts: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + active_customers: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_type: { + label: string; + type: string; + columns: string[]; + kanban: { + groupByField: string; + summarizeField: string; + columns: string[]; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + fields?: undefined; + caseSensitive?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + fields: string[]; + caseSensitive: boolean; + condition?: undefined; + })[]; + workflows: { + name: string; + objectName: string; + triggerType: string; + criteria: string; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + active: boolean; + }[]; + } | { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + salutation: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + first_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + last_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + full_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "formula"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "master_detail"; + }; + email: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "email"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mobile: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + title: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + department: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + reports_to: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + mailing_street: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + mailing_city: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_state: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_postal_code: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_country: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + birthdate: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_primary: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + do_not_call: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + email_opt_out: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + avatar: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "avatar"; + }; + }; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_contacts: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + primary_contacts: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_department: { + label: string; + type: string; + columns: string[]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + birthdays: { + label: string; + type: string; + columns: string[]; + calendar: { + startDateField: string; + titleField: string; + colorField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + fields?: undefined; + caseSensitive?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + fields: string[]; + caseSensitive: boolean; + condition?: undefined; + })[]; + workflows: { + name: string; + objectName: string; + triggerType: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + }[]; + } | { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + nameField: string; + fields: { + name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + primary_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + amount: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + expected_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + stage: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + probability: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "percent"; + }; + close_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + created_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + competitors: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + campaign: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + days_in_stage: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + next_step: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + is_private: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + forecast_category: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + }; + indexes: { + fields: string[]; + unique: false; + }[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + apiMethods: ("get" | "list" | "create" | "update" | "delete" | "aggregate" | "search")[]; + files: true; + feedEnabled: true; + trash: true; + }; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_opportunities: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + closing_this_month: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + won_opportunities: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + pipeline: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + kanban: { + groupByField: string; + summarizeField: string; + columns: string[]; + }; + }; + timeline: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + gantt: { + startDateField: string; + endDateField: string; + titleField: string; + progressField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + field?: undefined; + transitions?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + field: string; + transitions: { + prospecting: string[]; + qualification: string[]; + needs_analysis: string[]; + proposal: string[]; + negotiation: string[]; + closed_won: never[]; + closed_lost: never[]; + }; + condition?: undefined; + })[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; + } | { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + salutation: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + first_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + last_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + full_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "formula"; + }; + company: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + title: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + industry: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + email: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "email"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mobile: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + website: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "url"; + }; + status: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + rating: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + is_converted: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + converted_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_opportunity: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + address: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "address"; + }; + annual_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + number_of_employees: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "richtext"; + }; + do_not_call: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + email_opt_out: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + }; + indexes: ({ + fields: string[]; + unique: true; + } | { + fields: string[]; + unique: false; + })[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_leads: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + new_leads: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + hot_leads: { + label: string; + type: string; + columns: string[]; + filter: ((string | number)[] | (string | boolean)[])[]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: { + name: string; + type: string; + severity: string; + message: string; + condition: string; + }[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; + } | { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + case_number: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "autonumber"; + }; + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + status: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + priority: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + origin: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + created_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + closed_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + first_response_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + resolution_time_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + sla_due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + is_sla_violated: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + is_escalated: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + escalation_reason: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + parent_case: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + resolution: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + customer_rating: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + customer_feedback: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + customer_signature: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "signature"; + }; + internal_notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_closed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + }; + indexes: ({ + fields: string[]; + unique: true; + } | { + fields: string[]; + unique: false; + })[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_cases: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + open_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + critical_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + escalated_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + sla_violations: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + field?: undefined; + transitions?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + field: string; + transitions: { + new: string[]; + in_progress: string[]; + waiting_customer: string[]; + waiting_support: string[]; + escalated: string[]; + resolved: string[]; + closed: string[]; + }; + condition?: undefined; + })[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; + } | { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + status: { + type: "select"; + label: string; + required: true; + options: ({ + label: string; + value: string; + color: string; + default: true; + } | { + label: string; + value: string; + color: string; + default?: undefined; + })[]; + }; + priority: { + type: "select"; + label: string; + required: true; + options: ({ + label: string; + value: string; + color: string; + default: true; + } | { + label: string; + value: string; + color: string; + default?: undefined; + })[]; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + reminder_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + completed_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + related_to_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_opportunity: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_lead: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_case: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + is_recurring: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + recurrence_type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + recurrence_interval: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + recurrence_end_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + is_completed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + is_overdue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + progress_percent: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "percent"; + }; + estimated_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + actual_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + }; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_tasks: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + open_tasks: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + overdue_tasks: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + today_tasks: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + calendar: { + label: string; + type: string; + columns: string[]; + calendar: { + startDateField: string; + titleField: string; + colorField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: { + name: string; + type: string; + severity: string; + message: string; + condition: string; + }[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; + })[]; + apis: ({ + name: string; + path: string; + method: "GET"; + summary: string; + description: string; + type: "script"; + target: string; + authRequired: true; + cacheTtl: number; + } | { + name: string; + path: string; + method: "POST"; + summary: string; + type: "flow"; + target: string; + inputMapping: { + source: string; + target: string; + }[]; + })[]; + navigation: { + id: string; + type: string; + label: string; + children: ({ + id: string; + type: string; + objectName: string; + label: string; + dashboardName?: undefined; + } | { + id: string; + type: string; + dashboardName: string; + label: string; + objectName?: undefined; + })[]; + }[]; + actions: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }[]; + dashboards: { + label: string; + name: string; + widgets: { + type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table"; + aggregate: "min" | "max" | "count" | "sum" | "avg"; + layout: { + x: number; + y: number; + w: number; + h: number; + }; + object?: string | undefined; + filter?: import("@objectstack/spec").FilterCondition | undefined; + options?: any; + title?: string | undefined; + categoryField?: string | undefined; + valueField?: string | undefined; + }[]; + description?: string | undefined; + }[]; + reports: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }[]; + branding: { + primaryColor: string; + logo: string; + favicon: string; + }; +}; +export default _default; +//# sourceMappingURL=objectstack.config.d.ts.map \ No newline at end of file diff --git a/examples/crm/objectstack.config.d.ts.map b/examples/crm/objectstack.config.d.ts.map new file mode 100644 index 0000000..99244ee --- /dev/null +++ b/examples/crm/objectstack.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectstack.config.d.ts","sourceRoot":"","sources":["objectstack.config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;yBA8Fyg4C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA7upC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA4u8C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAApjhC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA/tS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAroJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA4zkB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAqjqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA11E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAznJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAjoT,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxpgC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAgwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAunqD,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxmgB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAl08C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwjgC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2ulB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAArx8B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA1rpB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA4u8C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAz08C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAv1E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAuoS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA0jqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA90O,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxpgC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAo4tB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAj27B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA+hhD,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAv2lC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA89gC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAArw8B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAt7N,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAiwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA8wlC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3h4C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA+2kC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAnvpC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAgjJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAq2uC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAl08C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwjgC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA9ogC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA4u8C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAnrzB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA1rpB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA4zkB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAq43B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAi1kB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAv6kB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA9uzC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwpzC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAvpqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA873C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAApuzC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA/tS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA+2kC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAutlB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA15lD,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAgx7B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA7upC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAy8tC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2iT,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA91E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAvpqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA/6N,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAy1N,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAloJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAtoJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAmv8C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAjoT,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAonzB,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAl58D,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAqlhE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAn+3B,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxpgC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAl7N,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAy8tC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwvO,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAhpqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAiwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAikqC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA91E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwwE,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA9uzC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAq2uC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxuzC,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA6iJ,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAt1E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2oS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA9gX,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA3C,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAp+S,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;kBAA0c,CAAC;kBAAoC,CAAC;mBAA2E,CAAC;iBAAoB,CAAC;yBAA2C,CAAC;sBAAwC,CAAC;;;;;;;;;;;iBAA13B,CAAC;qBAAuC,CAAC;;;;;;;2BAA+R,CAAC;;;;;2BAA2L,CAAC;;;;;;;iBAA0Q,CAAC;;;;;;;;;AAjFriG,wBAiFG"} \ No newline at end of file diff --git a/examples/crm/objectstack.config.js b/examples/crm/objectstack.config.js new file mode 100644 index 0000000..cd3983a --- /dev/null +++ b/examples/crm/objectstack.config.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const spec_1 = require("@objectstack/spec"); +const account_object_1 = require("./src/domains/crm/account.object"); +const contact_object_1 = require("./src/domains/crm/contact.object"); +const opportunity_object_1 = require("./src/domains/crm/opportunity.object"); +const lead_object_1 = require("./src/domains/crm/lead.object"); +const case_object_1 = require("./src/domains/crm/case.object"); +const task_object_1 = require("./src/domains/crm/task.object"); +const server_1 = require("./src/server"); +const actions_1 = require("./src/ui/actions"); +const dashboards_1 = require("./src/ui/dashboards"); +const reports_1 = require("./src/ui/reports"); +exports.default = spec_1.App.create({ + name: 'crm_example', + label: 'CRM App', + description: 'Comprehensive CRM example demonstrating all ObjectStack Protocol features', + version: '2.0.0', + icon: 'briefcase', + // All objects in the app + objects: [ + account_object_1.Account, + contact_object_1.Contact, + opportunity_object_1.Opportunity, + lead_object_1.Lead, + case_object_1.Case, + task_object_1.Task + ], + // Custom APIs + apis: [ + server_1.PipelineStatsApi, + server_1.LeadConvertApi + ], + // Navigation menu structure + navigation: [ + { + id: 'group_sales', + type: 'group', + label: 'Sales', + children: [ + { id: 'nav_lead', type: 'object', objectName: 'lead', label: 'Leads' }, + { id: 'nav_account', type: 'object', objectName: 'account', label: 'Accounts' }, + { id: 'nav_contact', type: 'object', objectName: 'contact', label: 'Contacts' }, + { id: 'nav_opportunity', type: 'object', objectName: 'opportunity', label: 'Opportunities' }, + { id: 'nav_sales_dashboard', type: 'dashboard', dashboardName: 'sales_dashboard', label: 'Sales Dashboard' }, + ] + }, + { + id: 'group_service', + type: 'group', + label: 'Service', + children: [ + { id: 'nav_case', type: 'object', objectName: 'case', label: 'Cases' }, + { id: 'nav_service_dashboard', type: 'dashboard', dashboardName: 'service_dashboard', label: 'Service Dashboard' }, + ] + }, + { + id: 'group_activities', + type: 'group', + label: 'Activities', + children: [ + { id: 'nav_task', type: 'object', objectName: 'task', label: 'Tasks' }, + ] + }, + { + id: 'group_analytics', + type: 'group', + label: 'Analytics', + children: [ + { id: 'nav_exec_dashboard', type: 'dashboard', dashboardName: 'executive_dashboard', label: 'Executive Dashboard' }, + { id: 'nav_analytics_sales_db', type: 'dashboard', dashboardName: 'sales_dashboard', label: 'Sales Dashboard' }, + { id: 'nav_analytics_service_db', type: 'dashboard', dashboardName: 'service_dashboard', label: 'Service Dashboard' }, + ] + } + ], + // Actions available in the app + actions: Object.values(actions_1.CrmActions), + // Dashboards + dashboards: Object.values(dashboards_1.CrmDashboards), + // Reports + reports: Object.values(reports_1.CrmReports), + // App-level branding + branding: { + primaryColor: '#4169E1', + logo: '/assets/crm-logo.png', + favicon: '/assets/crm-favicon.ico', + } +}); diff --git a/examples/crm/src/domains/crm/account.object.d.ts b/examples/crm/src/domains/crm/account.object.d.ts new file mode 100644 index 0000000..6aaa16b --- /dev/null +++ b/examples/crm/src/domains/crm/account.object.d.ts @@ -0,0 +1,926 @@ +export declare const Account: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + nameField: string; + fields: { + account_number: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "autonumber"; + }; + name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + industry: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + annual_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + number_of_employees: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + website: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "url"; + }; + billing_address: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "address"; + }; + office_location: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "location"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + parent_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_active: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + last_activity_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + brand_color: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "color"; + }; + }; + indexes: { + fields: string[]; + unique: false; + }[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + apiMethods: ("get" | "list" | "create" | "update" | "delete" | "search" | "export")[]; + files: true; + feedEnabled: true; + trash: true; + }; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_accounts: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + active_customers: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_type: { + label: string; + type: string; + columns: string[]; + kanban: { + groupByField: string; + summarizeField: string; + columns: string[]; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + fields?: undefined; + caseSensitive?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + fields: string[]; + caseSensitive: boolean; + condition?: undefined; + })[]; + workflows: { + name: string; + objectName: string; + triggerType: string; + criteria: string; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + active: boolean; + }[]; +}; +//# sourceMappingURL=account.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/account.object.d.ts.map b/examples/crm/src/domains/crm/account.object.d.ts.map new file mode 100644 index 0000000..3f0ddac --- /dev/null +++ b/examples/crm/src/domains/crm/account.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"account.object.d.ts","sourceRoot":"","sources":["account.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;;qBAqP09wC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA7upC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA4u8C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAApjhC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA/tS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAroJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA4zkB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqjqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA11E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAznJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAjoT,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAxpgC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAgwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAunqD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAzqkE,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/account.object.js b/examples/crm/src/domains/crm/account.object.js new file mode 100644 index 0000000..62fb040 --- /dev/null +++ b/examples/crm/src/domains/crm/account.object.js @@ -0,0 +1,228 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Account = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Account = spec_1.ObjectSchema.create({ + name: 'account', + label: 'Account', + pluralLabel: 'Accounts', + icon: 'building', + description: 'Companies and organizations doing business with us', + nameField: 'name', + fields: { + // AutoNumber field - Unique account identifier + account_number: spec_1.Field.autonumber({ + label: 'Account Number', + format: 'ACC-{0000}', + }), + // Basic Information + name: spec_1.Field.text({ + label: 'Account Name', + required: true, + searchable: true, + maxLength: 255, + }), + // Select fields with custom options + type: spec_1.Field.select({ + label: 'Account Type', + options: [ + { label: 'Prospect', value: 'prospect', color: '#FFA500', default: true }, + { label: 'Customer', value: 'customer', color: '#00AA00' }, + { label: 'Partner', value: 'partner', color: '#0000FF' }, + { label: 'Former Customer', value: 'former', color: '#999999' }, + ] + }), + industry: spec_1.Field.select({ + label: 'Industry', + options: [ + { label: 'Technology', value: 'technology' }, + { label: 'Finance', value: 'finance' }, + { label: 'Healthcare', value: 'healthcare' }, + { label: 'Retail', value: 'retail' }, + { label: 'Manufacturing', value: 'manufacturing' }, + { label: 'Education', value: 'education' }, + ] + }), + // Number fields + annual_revenue: spec_1.Field.currency({ + label: 'Annual Revenue', + scale: 2, + min: 0, + }), + number_of_employees: spec_1.Field.number({ + label: 'Employees', + min: 0, + }), + // Contact Information + phone: spec_1.Field.text({ + label: 'Phone', + format: 'phone', + }), + website: spec_1.Field.url({ + label: 'Website', + }), + // Structured Address field (new field type) + billing_address: spec_1.Field.address({ + label: 'Billing Address', + addressFormat: 'international', + }), + // Office Location (new field type) + office_location: spec_1.Field.location({ + label: 'Office Location', + displayMap: true, + allowGeocoding: true, + }), + // Relationship fields + owner: spec_1.Field.lookup('user', { + label: 'Account Owner', + required: true, + }), + parent_account: spec_1.Field.lookup('account', { + label: 'Parent Account', + description: 'Parent company in hierarchy', + }), + // Rich text field + description: spec_1.Field.markdown({ + label: 'Description', + }), + // Boolean field + is_active: spec_1.Field.boolean({ + label: 'Active', + defaultValue: true, + }), + // Date field + last_activity_date: spec_1.Field.date({ + label: 'Last Activity Date', + readonly: true, + }), + // Brand color (new field type) + brand_color: spec_1.Field.color({ + label: 'Brand Color', + colorFormat: 'hex', + presetColors: ['#FF0000', '#00FF00', '#0000FF', '#FFFF00', '#FF00FF', '#00FFFF'], + }), + }, + // Database indexes for performance + indexes: [ + { fields: ['name'], unique: false }, + { fields: ['owner'], unique: false }, + { fields: ['type', 'is_active'], unique: false }, + ], + // Enable advanced features + enable: { + trackHistory: true, // Track field changes + searchable: true, // Include in global search + apiEnabled: true, // Expose via REST/GraphQL + apiMethods: ['get', 'list', 'create', 'update', 'delete', 'search', 'export'], // Whitelist allowed API operations + files: true, // Allow file attachments + feedEnabled: true, // Enable activity feed/chatter + trash: true, // Recycle bin support + }, + // List Views - Different visualization types + list_views: { + all: { + label: 'All Accounts', + type: 'grid', + columns: ['account_number', 'name', 'type', 'industry', 'annual_revenue', 'owner'], + sort: [{ field: 'name', order: 'asc' }], + searchableFields: ['name', 'account_number', 'phone', 'website'], + }, + my_accounts: { + label: 'My Accounts', + type: 'grid', + columns: ['name', 'type', 'industry', 'annual_revenue', 'last_activity_date'], + filter: [['owner', '=', '{current_user}']], + sort: [{ field: 'last_activity_date', order: 'desc' }], + }, + active_customers: { + label: 'Active Customers', + type: 'grid', + columns: ['name', 'industry', 'annual_revenue', 'number_of_employees'], + filter: [ + ['type', '=', 'customer'], + ['is_active', '=', true] + ], + }, + by_type: { + label: 'Accounts by Type', + type: 'kanban', + columns: ['name', 'industry', 'annual_revenue'], + kanban: { + groupByField: 'type', + summarizeField: 'annual_revenue', + columns: ['name', 'industry', 'owner'], + } + } + }, + // Form Views + form_views: { + default: { + type: 'tabbed', + sections: [ + { + label: 'Account Information', + columns: 2, + fields: ['account_number', 'name', 'type', 'industry', 'owner', 'parent_account', 'is_active'] + }, + { + label: 'Financial Information', + columns: 2, + fields: ['annual_revenue', 'number_of_employees'] + }, + { + label: 'Contact Details', + columns: 2, + fields: ['phone', 'website', 'brand_color'] + }, + { + label: 'Location & Address', + columns: 2, + fields: ['billing_address', 'office_location'] + }, + { + label: 'Additional Information', + columns: 1, + collapsible: true, + collapsed: true, + fields: ['description', 'last_activity_date'] + } + ] + } + }, + // Validation Rules + validations: [ + { + name: 'revenue_positive', + type: 'script', + severity: 'error', + message: 'Annual Revenue must be positive', + condition: 'annual_revenue < 0', + }, + { + name: 'account_name_unique', + type: 'unique', + severity: 'error', + message: 'Account name must be unique', + fields: ['name'], + caseSensitive: false, + }, + ], + // Workflow Rules + workflows: [ + { + name: 'update_last_activity', + objectName: 'account', + triggerType: 'on_update', + criteria: 'ISCHANGED(owner) OR ISCHANGED(type)', + actions: [ + { + name: 'set_activity_date', + type: 'field_update', + field: 'last_activity_date', + value: 'TODAY()', + } + ], + active: true, + } + ], +}); diff --git a/examples/crm/src/domains/crm/case.object.d.ts b/examples/crm/src/domains/crm/case.object.d.ts new file mode 100644 index 0000000..849d242 --- /dev/null +++ b/examples/crm/src/domains/crm/case.object.d.ts @@ -0,0 +1,1435 @@ +export declare const Case: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + case_number: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "autonumber"; + }; + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + status: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + priority: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + origin: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + created_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + closed_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + first_response_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + resolution_time_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + sla_due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + is_sla_violated: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + is_escalated: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + escalation_reason: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + parent_case: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + resolution: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + customer_rating: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + customer_feedback: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + customer_signature: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "signature"; + }; + internal_notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_closed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + }; + indexes: ({ + fields: string[]; + unique: true; + } | { + fields: string[]; + unique: false; + })[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_cases: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + open_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + critical_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + escalated_cases: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + sla_violations: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + field?: undefined; + transitions?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + field: string; + transitions: { + new: string[]; + in_progress: string[]; + waiting_customer: string[]; + waiting_support: string[]; + escalated: string[]; + resolved: string[]; + closed: string[]; + }; + condition?: undefined; + })[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; +}; +//# sourceMappingURL=case.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/case.object.d.ts.map b/examples/crm/src/domains/crm/case.object.d.ts.map new file mode 100644 index 0000000..e0ba26c --- /dev/null +++ b/examples/crm/src/domains/crm/case.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"case.object.d.ts","sourceRoot":"","sources":["case.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;qBAyYk4oC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAb56oC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAawotC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA2iT,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA91E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAvpqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA/6N,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAy1N,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAloJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAtoJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAmv8C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAjoT,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAonzB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAl58D,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAqlhE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAn+3B,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAxpgC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADjoN,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/case.object.js b/examples/crm/src/domains/crm/case.object.js new file mode 100644 index 0000000..53f36a5 --- /dev/null +++ b/examples/crm/src/domains/crm/case.object.js @@ -0,0 +1,365 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Case = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Case = spec_1.ObjectSchema.create({ + name: 'case', + label: 'Case', + pluralLabel: 'Cases', + icon: 'life-buoy', + description: 'Customer support cases and service requests', + fields: { + // Case Information + case_number: spec_1.Field.autonumber({ + label: 'Case Number', + format: 'CASE-{00000}', + }), + subject: spec_1.Field.text({ + label: 'Subject', + required: true, + searchable: true, + maxLength: 255, + }), + description: spec_1.Field.markdown({ + label: 'Description', + required: true, + }), + // Relationships + account: spec_1.Field.lookup('account', { + label: 'Account', + }), + contact: spec_1.Field.lookup('contact', { + label: 'Contact', + required: true, + referenceFilters: ['account = {case.account}'], + }), + // Case Management + status: spec_1.Field.select({ + label: 'Status', + required: true, + options: [ + { label: 'New', value: 'new', color: '#808080', default: true }, + { label: 'In Progress', value: 'in_progress', color: '#FFA500' }, + { label: 'Waiting on Customer', value: 'waiting_customer', color: '#FFD700' }, + { label: 'Waiting on Support', value: 'waiting_support', color: '#4169E1' }, + { label: 'Escalated', value: 'escalated', color: '#FF0000' }, + { label: 'Resolved', value: 'resolved', color: '#00AA00' }, + { label: 'Closed', value: 'closed', color: '#006400' }, + ] + }), + priority: spec_1.Field.select({ + label: 'Priority', + required: true, + options: [ + { label: 'Low', value: 'low', color: '#4169E1', default: true }, + { label: 'Medium', value: 'medium', color: '#FFA500' }, + { label: 'High', value: 'high', color: '#FF4500' }, + { label: 'Critical', value: 'critical', color: '#FF0000' }, + ] + }), + type: spec_1.Field.select(['Question', 'Problem', 'Feature Request', 'Bug'], { + label: 'Case Type', + }), + origin: spec_1.Field.select(['Email', 'Phone', 'Web', 'Chat', 'Social Media'], { + label: 'Case Origin', + }), + // Assignment + owner: spec_1.Field.lookup('user', { + label: 'Case Owner', + required: true, + }), + // SLA and Metrics + created_date: spec_1.Field.datetime({ + label: 'Created Date', + readonly: true, + }), + closed_date: spec_1.Field.datetime({ + label: 'Closed Date', + readonly: true, + }), + first_response_date: spec_1.Field.datetime({ + label: 'First Response Date', + readonly: true, + }), + resolution_time_hours: spec_1.Field.number({ + label: 'Resolution Time (Hours)', + readonly: true, + scale: 2, + }), + sla_due_date: spec_1.Field.datetime({ + label: 'SLA Due Date', + }), + is_sla_violated: spec_1.Field.boolean({ + label: 'SLA Violated', + defaultValue: false, + readonly: true, + }), + // Escalation + is_escalated: spec_1.Field.boolean({ + label: 'Escalated', + defaultValue: false, + }), + escalation_reason: spec_1.Field.textarea({ + label: 'Escalation Reason', + }), + // Related case + parent_case: spec_1.Field.lookup('case', { + label: 'Parent Case', + description: 'Related parent case', + }), + // Resolution + resolution: spec_1.Field.markdown({ + label: 'Resolution', + }), + // Customer satisfaction + customer_rating: spec_1.Field.rating(5, { + label: 'Customer Satisfaction', + description: 'Customer satisfaction rating (1-5 stars)', + }), + customer_feedback: spec_1.Field.textarea({ + label: 'Customer Feedback', + }), + // Customer signature (for case resolution acknowledgment) + customer_signature: spec_1.Field.signature({ + label: 'Customer Signature', + description: 'Digital signature acknowledging case resolution', + }), + // Internal notes + internal_notes: spec_1.Field.markdown({ + label: 'Internal Notes', + description: 'Internal notes not visible to customer', + }), + // Flags + is_closed: spec_1.Field.boolean({ + label: 'Is Closed', + defaultValue: false, + readonly: true, + }), + }, + // Database indexes for performance + indexes: [ + { fields: ['case_number'], unique: true }, + { fields: ['account'], unique: false }, + { fields: ['owner'], unique: false }, + { fields: ['status'], unique: false }, + { fields: ['priority'], unique: false }, + ], + enable: { + trackHistory: true, + searchable: true, + apiEnabled: true, + files: true, + feedEnabled: true, + trash: true, + }, + nameField: 'subject', + list_views: { + all: { + label: 'All Cases', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'contact', 'status', 'priority', 'owner'], + sort: [{ field: 'created_date', order: 'desc' }], + searchableFields: ['case_number', 'subject', 'description'], + }, + my_cases: { + label: 'My Cases', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'status', 'priority'], + filter: [['owner', '=', '{current_user}']], + sort: [{ field: 'priority', order: 'desc' }], + }, + open_cases: { + label: 'Open Cases', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'status', 'priority', 'owner'], + filter: [['is_closed', '=', false]], + sort: [{ field: 'priority', order: 'desc' }], + }, + critical_cases: { + label: 'Critical Cases', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'contact', 'status', 'owner'], + filter: [ + ['priority', '=', 'critical'], + ['is_closed', '=', false], + ], + sort: [{ field: 'created_date', order: 'asc' }], + }, + escalated_cases: { + label: 'Escalated Cases', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'priority', 'escalation_reason', 'owner'], + filter: [['is_escalated', '=', true]], + }, + by_status: { + label: 'Cases by Status', + type: 'kanban', + columns: ['case_number', 'subject', 'account', 'priority'], + filter: [['is_closed', '=', false]], + kanban: { + groupByField: 'status', + columns: ['case_number', 'subject', 'contact', 'priority'], + } + }, + sla_violations: { + label: 'SLA Violations', + type: 'grid', + columns: ['case_number', 'subject', 'account', 'sla_due_date', 'owner'], + filter: [['is_sla_violated', '=', true]], + sort: [{ field: 'sla_due_date', order: 'asc' }], + } + }, + form_views: { + default: { + type: 'tabbed', + sections: [ + { + label: 'Case Information', + columns: 2, + fields: ['case_number', 'subject', 'type', 'origin', 'priority', 'status', 'owner'], + }, + { + label: 'Customer Information', + columns: 2, + fields: ['account', 'contact'], + }, + { + label: 'Description', + columns: 1, + fields: ['description'], + }, + { + label: 'Resolution', + columns: 1, + fields: ['resolution', 'customer_rating', 'customer_feedback', 'customer_signature'], + }, + { + label: 'SLA & Metrics', + columns: 2, + fields: ['created_date', 'first_response_date', 'closed_date', 'resolution_time_hours', 'sla_due_date', 'is_sla_violated'], + }, + { + label: 'Escalation', + columns: 2, + collapsible: true, + fields: ['is_escalated', 'escalation_reason', 'parent_case'], + }, + { + label: 'Internal Information', + columns: 1, + collapsible: true, + fields: ['internal_notes'], + } + ] + } + }, + validations: [ + { + name: 'resolution_required_for_closed', + type: 'script', + severity: 'error', + message: 'Resolution is required when closing a case', + condition: 'status = "closed" AND ISBLANK(resolution)', + }, + { + name: 'escalation_reason_required', + type: 'script', + severity: 'error', + message: 'Escalation reason is required when escalating a case', + condition: 'is_escalated = true AND ISBLANK(escalation_reason)', + }, + { + name: 'case_status_progression', + type: 'state_machine', + severity: 'warning', + message: 'Invalid status transition', + field: 'status', + transitions: { + 'new': ['in_progress', 'waiting_customer', 'closed'], + 'in_progress': ['waiting_customer', 'waiting_support', 'escalated', 'resolved'], + 'waiting_customer': ['in_progress', 'closed'], + 'waiting_support': ['in_progress', 'escalated'], + 'escalated': ['in_progress', 'resolved'], + 'resolved': ['closed', 'in_progress'], // Can reopen + 'closed': ['in_progress'], // Can reopen + } + }, + ], + workflows: [ + { + name: 'set_closed_flag', + objectName: 'case', + triggerType: 'on_create_or_update', + criteria: 'ISCHANGED(status)', + active: true, + actions: [ + { + name: 'update_closed_flag', + type: 'field_update', + field: 'is_closed', + value: 'status = "closed"', + } + ], + }, + { + name: 'set_closed_date', + objectName: 'case', + triggerType: 'on_update', + criteria: 'ISCHANGED(status) AND status = "closed"', + active: true, + actions: [ + { + name: 'set_date', + type: 'field_update', + field: 'closed_date', + value: 'NOW()', + } + ], + }, + { + name: 'calculate_resolution_time', + objectName: 'case', + triggerType: 'on_update', + criteria: 'ISCHANGED(closed_date) AND NOT(ISBLANK(closed_date))', + active: true, + actions: [ + { + name: 'calc_time', + type: 'field_update', + field: 'resolution_time_hours', + value: 'HOURS(created_date, closed_date)', + } + ], + }, + { + name: 'notify_on_critical', + objectName: 'case', + triggerType: 'on_create_or_update', + criteria: 'priority = "critical"', + active: true, + actions: [ + { + name: 'email_support_manager', + type: 'email_alert', + template: 'critical_case_alert', + recipients: ['support_manager@example.com'], + } + ], + }, + { + name: 'notify_on_escalation', + objectName: 'case', + triggerType: 'on_update', + criteria: 'ISCHANGED(is_escalated) AND is_escalated = true', + active: true, + actions: [ + { + name: 'email_escalation_team', + type: 'email_alert', + template: 'case_escalation_alert', + recipients: ['escalation_team@example.com'], + } + ], + }, + ], +}); diff --git a/examples/crm/src/domains/crm/contact.object.d.ts b/examples/crm/src/domains/crm/contact.object.d.ts new file mode 100644 index 0000000..cfda7d7 --- /dev/null +++ b/examples/crm/src/domains/crm/contact.object.d.ts @@ -0,0 +1,1331 @@ +export declare const Contact: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + salutation: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + first_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + last_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + full_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "formula"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "master_detail"; + }; + email: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "email"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mobile: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + title: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + department: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + reports_to: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + mailing_street: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + mailing_city: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_state: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_postal_code: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mailing_country: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + birthdate: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + is_primary: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + do_not_call: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + email_opt_out: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + avatar: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "avatar"; + }; + }; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_contacts: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + primary_contacts: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + }; + by_department: { + label: string; + type: string; + columns: string[]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + birthdays: { + label: string; + type: string; + columns: string[]; + calendar: { + startDateField: string; + titleField: string; + colorField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + fields?: undefined; + caseSensitive?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + fields: string[]; + caseSensitive: boolean; + condition?: undefined; + })[]; + workflows: { + name: string; + objectName: string; + triggerType: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + }[]; +}; +//# sourceMappingURL=contact.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/contact.object.d.ts.map b/examples/crm/src/domains/crm/contact.object.d.ts.map new file mode 100644 index 0000000..f67bf4f --- /dev/null +++ b/examples/crm/src/domains/crm/contact.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"contact.object.d.ts","sourceRoot":"","sources":["contact.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;;;;;;;;;qBA8Ok/kD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAl08C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwjgC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA2ulB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAArx8B,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA1rpB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA4u8C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAz08C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAv1E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAuoS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA0jqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA90O,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAxpgC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAo4tB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA9kkC,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/contact.object.js b/examples/crm/src/domains/crm/contact.object.js new file mode 100644 index 0000000..6c3dc68 --- /dev/null +++ b/examples/crm/src/domains/crm/contact.object.js @@ -0,0 +1,219 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Contact = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Contact = spec_1.ObjectSchema.create({ + name: 'contact', + label: 'Contact', + pluralLabel: 'Contacts', + icon: 'user', + description: 'People associated with accounts', + fields: { + // Name fields + salutation: spec_1.Field.select(['Mr.', 'Ms.', 'Mrs.', 'Dr.', 'Prof.'], { + label: 'Salutation', + }), + first_name: spec_1.Field.text({ + label: 'First Name', + required: true, + searchable: true, + }), + last_name: spec_1.Field.text({ + label: 'Last Name', + required: true, + searchable: true, + }), + // Formula field - Full name + full_name: spec_1.Field.formula({ + label: 'Full Name', + expression: 'CONCAT(salutation, " ", first_name, " ", last_name)', + }), + // Relationship: Link to Account (Master-Detail) + account: spec_1.Field.masterDetail('account', { + label: 'Account', + required: true, + writeRequiresMasterRead: true, + deleteBehavior: 'cascade', // Delete contacts when account is deleted + }), + // Contact Information + email: spec_1.Field.email({ + label: 'Email', + required: true, + unique: true, + }), + phone: spec_1.Field.text({ + label: 'Phone', + format: 'phone', + }), + mobile: spec_1.Field.text({ + label: 'Mobile', + format: 'phone', + }), + // Professional Information + title: spec_1.Field.text({ + label: 'Job Title', + }), + department: spec_1.Field.select(['Executive', 'Sales', 'Marketing', 'Engineering', 'Support', 'Finance', 'HR', 'Operations'], { + label: 'Department', + }), + // Relationship fields + reports_to: spec_1.Field.lookup('contact', { + label: 'Reports To', + description: 'Direct manager/supervisor', + }), + owner: spec_1.Field.lookup('user', { + label: 'Contact Owner', + required: true, + }), + // Mailing Address + mailing_street: spec_1.Field.textarea({ label: 'Mailing Street' }), + mailing_city: spec_1.Field.text({ label: 'Mailing City' }), + mailing_state: spec_1.Field.text({ label: 'Mailing State/Province' }), + mailing_postal_code: spec_1.Field.text({ label: 'Mailing Postal Code' }), + mailing_country: spec_1.Field.text({ label: 'Mailing Country' }), + // Additional Information + birthdate: spec_1.Field.date({ + label: 'Birthdate', + }), + lead_source: spec_1.Field.select(['Web', 'Referral', 'Event', 'Partner', 'Advertisement'], { + label: 'Lead Source', + }), + description: spec_1.Field.markdown({ + label: 'Description', + }), + // Flags + is_primary: spec_1.Field.boolean({ + label: 'Primary Contact', + defaultValue: false, + description: 'Is this the main contact for the account?', + }), + do_not_call: spec_1.Field.boolean({ + label: 'Do Not Call', + defaultValue: false, + }), + email_opt_out: spec_1.Field.boolean({ + label: 'Email Opt Out', + defaultValue: false, + }), + // Avatar field + avatar: spec_1.Field.avatar({ + label: 'Profile Picture', + }), + }, + // Enable features + enable: { + trackHistory: true, + searchable: true, + apiEnabled: true, + files: true, + feedEnabled: true, + trash: true, + }, + // Name field configuration + nameField: 'full_name', + // List Views + list_views: { + all: { + label: 'All Contacts', + type: 'grid', + columns: ['full_name', 'account', 'title', 'email', 'phone', 'owner'], + sort: [{ field: 'last_name', order: 'asc' }], + searchableFields: ['first_name', 'last_name', 'email', 'phone'], + }, + my_contacts: { + label: 'My Contacts', + type: 'grid', + columns: ['full_name', 'account', 'title', 'email', 'phone'], + filter: [['owner', '=', '{current_user}']], + }, + primary_contacts: { + label: 'Primary Contacts', + type: 'grid', + columns: ['full_name', 'account', 'title', 'email', 'phone'], + filter: [['is_primary', '=', true]], + }, + by_department: { + label: 'By Department', + type: 'kanban', + columns: ['full_name', 'account', 'title', 'email'], + kanban: { + groupByField: 'department', + columns: ['full_name', 'title', 'email', 'phone'], + } + }, + birthdays: { + label: 'Birthdays', + type: 'calendar', + columns: ['full_name', 'account', 'phone'], + calendar: { + startDateField: 'birthdate', + titleField: 'full_name', + colorField: 'department', + } + } + }, + // Form Views + form_views: { + default: { + type: 'simple', + sections: [ + { + label: 'Contact Information', + columns: 2, + fields: ['salutation', 'first_name', 'last_name', 'full_name', 'account', 'title', 'department'], + }, + { + label: 'Contact Details', + columns: 2, + fields: ['email', 'phone', 'mobile', 'reports_to', 'owner'], + }, + { + label: 'Mailing Address', + columns: 2, + fields: ['mailing_street', 'mailing_city', 'mailing_state', 'mailing_postal_code', 'mailing_country'], + }, + { + label: 'Additional Information', + columns: 2, + collapsible: true, + fields: ['birthdate', 'lead_source', 'is_primary', 'do_not_call', 'email_opt_out', 'description'], + } + ] + } + }, + // Validation Rules + validations: [ + { + name: 'email_required_for_opt_in', + type: 'script', + severity: 'error', + message: 'Email is required when Email Opt Out is not checked', + condition: 'email_opt_out = false AND ISBLANK(email)', + }, + { + name: 'email_unique_per_account', + type: 'unique', + severity: 'error', + message: 'Email must be unique within an account', + fields: ['email', 'account'], + caseSensitive: false, + }, + ], + // Workflow Rules + workflows: [ + { + name: 'welcome_email', + objectName: 'contact', + triggerType: 'on_create', + active: true, + actions: [ + { + name: 'send_welcome', + type: 'email_alert', + template: 'contact_welcome', + recipients: ['{contact.email}'], + } + ], + } + ], +}); diff --git a/examples/crm/src/domains/crm/lead.object.d.ts b/examples/crm/src/domains/crm/lead.object.d.ts new file mode 100644 index 0000000..d6ec236 --- /dev/null +++ b/examples/crm/src/domains/crm/lead.object.d.ts @@ -0,0 +1,1503 @@ +export declare const Lead: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + salutation: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + first_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + last_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + full_name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "formula"; + }; + company: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + title: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + industry: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + email: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "email"; + }; + phone: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + mobile: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + website: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "url"; + }; + status: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + rating: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + is_converted: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + converted_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_opportunity: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + converted_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + address: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "address"; + }; + annual_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + number_of_employees: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "richtext"; + }; + do_not_call: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + email_opt_out: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + }; + indexes: ({ + fields: string[]; + unique: true; + } | { + fields: string[]; + unique: false; + })[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_leads: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + new_leads: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + hot_leads: { + label: string; + type: string; + columns: string[]; + filter: ((string | number)[] | (string | boolean)[])[]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + fields: string[]; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: { + name: string; + type: string; + severity: string; + message: string; + condition: string; + }[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; +}; +//# sourceMappingURL=lead.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/lead.object.d.ts.map b/examples/crm/src/domains/crm/lead.object.d.ts.map new file mode 100644 index 0000000..d18d58e --- /dev/null +++ b/examples/crm/src/domains/crm/lead.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lead.object.d.ts","sourceRoot":"","sources":["lead.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;qBAwT+yhD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAl08C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwjgC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA9ogC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA4u8C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAnrzB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA1rpB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA4zkB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAq43B,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAi1kB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAv6kB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA9uzC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwpzC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAvpqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA873C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAApuzC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA/tS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA+2kC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAutlB,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA15lD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADz9S,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/lead.object.js b/examples/crm/src/domains/crm/lead.object.js new file mode 100644 index 0000000..aa53348 --- /dev/null +++ b/examples/crm/src/domains/crm/lead.object.js @@ -0,0 +1,282 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Lead = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Lead = spec_1.ObjectSchema.create({ + name: 'lead', + label: 'Lead', + pluralLabel: 'Leads', + icon: 'user-plus', + description: 'Potential customers not yet qualified', + fields: { + // Personal Information + salutation: spec_1.Field.select(['Mr.', 'Ms.', 'Mrs.', 'Dr.'], { + label: 'Salutation', + }), + first_name: spec_1.Field.text({ + label: 'First Name', + required: true, + searchable: true, + }), + last_name: spec_1.Field.text({ + label: 'Last Name', + required: true, + searchable: true, + }), + full_name: spec_1.Field.formula({ + label: 'Full Name', + expression: 'CONCAT(salutation, " ", first_name, " ", last_name)', + }), + // Company Information + company: spec_1.Field.text({ + label: 'Company', + required: true, + searchable: true, + }), + title: spec_1.Field.text({ + label: 'Job Title', + }), + industry: spec_1.Field.select(['Technology', 'Finance', 'Healthcare', 'Retail', 'Manufacturing', 'Education'], { + label: 'Industry', + }), + // Contact Information + email: spec_1.Field.email({ + label: 'Email', + required: true, + unique: true, + }), + phone: spec_1.Field.text({ + label: 'Phone', + format: 'phone', + }), + mobile: spec_1.Field.text({ + label: 'Mobile', + format: 'phone', + }), + website: spec_1.Field.url({ + label: 'Website', + }), + // Lead Qualification + status: spec_1.Field.select({ + label: 'Lead Status', + required: true, + options: [ + { label: 'New', value: 'new', color: '#808080', default: true }, + { label: 'Contacted', value: 'contacted', color: '#FFA500' }, + { label: 'Qualified', value: 'qualified', color: '#4169E1' }, + { label: 'Unqualified', value: 'unqualified', color: '#FF0000' }, + { label: 'Converted', value: 'converted', color: '#00AA00' }, + ] + }), + rating: spec_1.Field.rating(5, { + label: 'Lead Score', + description: 'Lead quality score (1-5 stars)', + allowHalf: true, + }), + lead_source: spec_1.Field.select(['Web', 'Referral', 'Event', 'Partner', 'Advertisement', 'Cold Call'], { + label: 'Lead Source', + }), + // Assignment + owner: spec_1.Field.lookup('user', { + label: 'Lead Owner', + required: true, + }), + // Conversion tracking + is_converted: spec_1.Field.boolean({ + label: 'Converted', + defaultValue: false, + readonly: true, + }), + converted_account: spec_1.Field.lookup('account', { + label: 'Converted Account', + readonly: true, + }), + converted_contact: spec_1.Field.lookup('contact', { + label: 'Converted Contact', + readonly: true, + }), + converted_opportunity: spec_1.Field.lookup('opportunity', { + label: 'Converted Opportunity', + readonly: true, + }), + converted_date: spec_1.Field.datetime({ + label: 'Converted Date', + readonly: true, + }), + // Address (using new address field type) + address: spec_1.Field.address({ + label: 'Address', + addressFormat: 'international', + }), + // Additional Info + annual_revenue: spec_1.Field.currency({ + label: 'Annual Revenue', + scale: 2, + }), + number_of_employees: spec_1.Field.number({ + label: 'Number of Employees', + }), + description: spec_1.Field.markdown({ + label: 'Description', + }), + // Custom notes with rich text formatting + notes: spec_1.Field.richtext({ + label: 'Notes', + description: 'Rich text notes with formatting', + }), + // Flags + do_not_call: spec_1.Field.boolean({ + label: 'Do Not Call', + defaultValue: false, + }), + email_opt_out: spec_1.Field.boolean({ + label: 'Email Opt Out', + defaultValue: false, + }), + }, + // Database indexes for performance + indexes: [ + { fields: ['email'], unique: true }, + { fields: ['owner'], unique: false }, + { fields: ['status'], unique: false }, + { fields: ['company'], unique: false }, + ], + enable: { + trackHistory: true, + searchable: true, + apiEnabled: true, + files: true, + feedEnabled: true, + trash: true, + }, + nameField: 'full_name', + list_views: { + all: { + label: 'All Leads', + type: 'grid', + columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating', 'owner'], + sort: [{ field: 'last_name', order: 'asc' }], + searchableFields: ['first_name', 'last_name', 'company', 'email'], + }, + my_leads: { + label: 'My Leads', + type: 'grid', + columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating'], + filter: [['owner', '=', '{current_user}']], + }, + new_leads: { + label: 'New Leads', + type: 'grid', + columns: ['full_name', 'company', 'email', 'phone', 'lead_source', 'owner'], + filter: [['status', '=', 'new']], + sort: [{ field: 'created_date', order: 'desc' }], + }, + hot_leads: { + label: 'High Score Leads', + type: 'grid', + columns: ['full_name', 'company', 'email', 'phone', 'status', 'rating', 'owner'], + filter: [ + ['rating', '>=', 4], + ['is_converted', '=', false], + ], + }, + by_status: { + label: 'Leads by Status', + type: 'kanban', + columns: ['full_name', 'company', 'email', 'rating'], + filter: [['is_converted', '=', false]], + kanban: { + groupByField: 'status', + columns: ['full_name', 'company', 'email', 'phone', 'rating'], + } + }, + }, + form_views: { + default: { + type: 'simple', + sections: [ + { + label: 'Lead Information', + columns: 2, + fields: ['salutation', 'first_name', 'last_name', 'full_name', 'company', 'title', 'owner'], + }, + { + label: 'Contact Information', + columns: 2, + fields: ['email', 'phone', 'mobile', 'website'], + }, + { + label: 'Lead Details', + columns: 2, + fields: ['status', 'rating', 'lead_source', 'industry', 'annual_revenue', 'number_of_employees'], + }, + { + label: 'Address', + columns: 2, + fields: ['address'], + }, + { + label: 'Additional Information', + columns: 2, + collapsible: true, + fields: ['do_not_call', 'email_opt_out', 'description', 'notes'], + }, + { + label: 'Conversion Information', + columns: 2, + collapsible: true, + collapsed: true, + fields: ['is_converted', 'converted_account', 'converted_contact', 'converted_opportunity', 'converted_date'], + } + ] + } + }, + validations: [ + { + name: 'email_required', + type: 'script', + severity: 'error', + message: 'Email is required', + condition: 'ISBLANK(email)', + }, + { + name: 'cannot_edit_converted', + type: 'script', + severity: 'error', + message: 'Cannot edit a converted lead', + condition: 'is_converted = true AND ISCHANGED(company, email, first_name, last_name)', + }, + ], + workflows: [ + { + name: 'auto_qualify_high_score_leads', + objectName: 'lead', + triggerType: 'on_create_or_update', + criteria: 'rating >= 4 AND status = "new"', + active: true, + actions: [ + { + name: 'set_status', + type: 'field_update', + field: 'status', + value: 'contacted', + } + ], + }, + { + name: 'notify_owner_on_high_score_lead', + objectName: 'lead', + triggerType: 'on_create_or_update', + criteria: 'ISCHANGED(rating) AND rating >= 4.5', + active: true, + actions: [ + { + name: 'email_owner', + type: 'email_alert', + template: 'high_score_lead_notification', + recipients: ['{owner.email}'], + } + ], + } + ], +}); diff --git a/examples/crm/src/domains/crm/opportunity.object.d.ts b/examples/crm/src/domains/crm/opportunity.object.d.ts new file mode 100644 index 0000000..09f34a4 --- /dev/null +++ b/examples/crm/src/domains/crm/opportunity.object.d.ts @@ -0,0 +1,1126 @@ +export declare const Opportunity: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + nameField: string; + fields: { + name: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + primary_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + amount: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + expected_revenue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "currency"; + }; + stage: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + probability: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "percent"; + }; + close_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + created_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + lead_source: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + competitors: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + campaign: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + days_in_stage: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + next_step: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "textarea"; + }; + is_private: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + forecast_category: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + }; + indexes: { + fields: string[]; + unique: false; + }[]; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + apiMethods: ("get" | "list" | "create" | "update" | "delete" | "aggregate" | "search")[]; + files: true; + feedEnabled: true; + trash: true; + }; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_opportunities: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + closing_this_month: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + won_opportunities: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + pipeline: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + kanban: { + groupByField: string; + summarizeField: string; + columns: string[]; + }; + }; + timeline: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + gantt: { + startDateField: string; + endDateField: string; + titleField: string; + progressField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: ({ + name: string; + type: string; + severity: string; + message: string; + condition: string; + field?: undefined; + transitions?: undefined; + } | { + name: string; + type: string; + severity: string; + message: string; + field: string; + transitions: { + prospecting: string[]; + qualification: string[]; + needs_analysis: string[]; + proposal: string[]; + negotiation: string[]; + closed_won: never[]; + closed_lost: never[]; + }; + condition?: undefined; + })[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; +}; +//# sourceMappingURL=opportunity.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/opportunity.object.d.ts.map b/examples/crm/src/domains/crm/opportunity.object.d.ts.map new file mode 100644 index 0000000..24d3efa --- /dev/null +++ b/examples/crm/src/domains/crm/opportunity.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"opportunity.object.d.ts","sourceRoot":"","sources":["opportunity.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;qBAkWmS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA+hhD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAv2lC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA89gC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAArw8B,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAt7N,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAiwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA8wlC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3h4C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA+2kC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAnvpC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAgjJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAq2uC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA3n9C,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/opportunity.object.js b/examples/crm/src/domains/crm/opportunity.object.js new file mode 100644 index 0000000..486d107 --- /dev/null +++ b/examples/crm/src/domains/crm/opportunity.object.js @@ -0,0 +1,334 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Opportunity = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Opportunity = spec_1.ObjectSchema.create({ + name: 'opportunity', + label: 'Opportunity', + pluralLabel: 'Opportunities', + icon: 'dollar-sign', + description: 'Sales opportunities and deals in the pipeline', + nameField: 'name', + fields: { + // Basic Information + name: spec_1.Field.text({ + label: 'Opportunity Name', + required: true, + searchable: true, + }), + // Relationships + account: spec_1.Field.lookup('account', { + label: 'Account', + required: true, + }), + primary_contact: spec_1.Field.lookup('contact', { + label: 'Primary Contact', + referenceFilters: ['account = {opportunity.account}'], // Filter contacts by account + }), + owner: spec_1.Field.lookup('user', { + label: 'Opportunity Owner', + required: true, + }), + // Financial Information + amount: spec_1.Field.currency({ + label: 'Amount', + required: true, + scale: 2, + min: 0, + }), + expected_revenue: spec_1.Field.currency({ + label: 'Expected Revenue', + scale: 2, + readonly: true, // Calculated field + }), + // Sales Process + stage: spec_1.Field.select({ + label: 'Stage', + required: true, + options: [ + { label: 'Prospecting', value: 'prospecting', color: '#808080', default: true }, + { label: 'Qualification', value: 'qualification', color: '#FFA500' }, + { label: 'Needs Analysis', value: 'needs_analysis', color: '#FFD700' }, + { label: 'Proposal', value: 'proposal', color: '#4169E1' }, + { label: 'Negotiation', value: 'negotiation', color: '#9370DB' }, + { label: 'Closed Won', value: 'closed_won', color: '#00AA00' }, + { label: 'Closed Lost', value: 'closed_lost', color: '#FF0000' }, + ] + }), + probability: spec_1.Field.percent({ + label: 'Probability (%)', + min: 0, + max: 100, + defaultValue: 10, + }), + // Important Dates + close_date: spec_1.Field.date({ + label: 'Close Date', + required: true, + }), + created_date: spec_1.Field.datetime({ + label: 'Created Date', + readonly: true, + }), + // Additional Classification + type: spec_1.Field.select(['New Business', 'Existing Customer - Upgrade', 'Existing Customer - Renewal', 'Existing Customer - Expansion'], { + label: 'Opportunity Type', + }), + lead_source: spec_1.Field.select(['Web', 'Referral', 'Event', 'Partner', 'Advertisement', 'Cold Call'], { + label: 'Lead Source', + }), + // Competitor Analysis + competitors: spec_1.Field.select(['Competitor A', 'Competitor B', 'Competitor C'], { + label: 'Competitors', + multiple: true, + }), + // Campaign tracking + campaign: spec_1.Field.lookup('campaign', { + label: 'Campaign', + description: 'Marketing campaign that generated this opportunity', + }), + // Sales cycle metrics + days_in_stage: spec_1.Field.number({ + label: 'Days in Current Stage', + readonly: true, + }), + // Additional information + description: spec_1.Field.markdown({ + label: 'Description', + }), + next_step: spec_1.Field.textarea({ + label: 'Next Steps', + }), + // Flags + is_private: spec_1.Field.boolean({ + label: 'Private', + defaultValue: false, + }), + forecast_category: spec_1.Field.select(['Pipeline', 'Best Case', 'Commit', 'Omitted', 'Closed'], { + label: 'Forecast Category', + }), + }, + // Database indexes for performance + indexes: [ + { fields: ['name'], unique: false }, + { fields: ['account'], unique: false }, + { fields: ['owner'], unique: false }, + { fields: ['stage'], unique: false }, + { fields: ['close_date'], unique: false }, + ], + // Enable advanced features + enable: { + trackHistory: true, // Critical for tracking stage changes + searchable: true, + apiEnabled: true, + apiMethods: ['get', 'list', 'create', 'update', 'delete', 'aggregate', 'search'], // Whitelist allowed API operations + files: true, // Attach proposals, contracts + feedEnabled: true, // Team collaboration + trash: true, + }, + // List Views - Multiple visualization types + list_views: { + all: { + label: 'All Opportunities', + type: 'grid', + columns: ['name', 'account', 'amount', 'close_date', 'stage', 'probability', 'owner'], + sort: [{ field: 'close_date', order: 'asc' }], + searchableFields: ['name', 'account'], + }, + my_opportunities: { + label: 'My Opportunities', + type: 'grid', + columns: ['name', 'account', 'amount', 'close_date', 'stage', 'probability'], + filter: [['owner', '=', '{current_user}']], + sort: [{ field: 'close_date', order: 'asc' }], + }, + closing_this_month: { + label: 'Closing This Month', + type: 'grid', + columns: ['name', 'account', 'amount', 'stage', 'probability', 'owner'], + filter: [ + ['close_date', '>=', '{current_month_start}'], + ['close_date', '<=', '{current_month_end}'], + ['stage', '!=', 'closed_won'], + ['stage', '!=', 'closed_lost'], + ], + sort: [{ field: 'amount', order: 'desc' }], + }, + won_opportunities: { + label: 'Won Opportunities', + type: 'grid', + columns: ['name', 'account', 'amount', 'close_date', 'owner'], + filter: [['stage', '=', 'closed_won']], + sort: [{ field: 'close_date', order: 'desc' }], + }, + pipeline: { + label: 'Sales Pipeline', + type: 'kanban', + columns: ['name', 'account', 'amount', 'probability', 'close_date'], + filter: [ + ['stage', '!=', 'closed_won'], + ['stage', '!=', 'closed_lost'], + ], + kanban: { + groupByField: 'stage', + summarizeField: 'amount', + columns: ['name', 'account', 'amount', 'close_date'], + } + }, + timeline: { + label: 'Close Date Timeline', + type: 'gantt', + columns: ['name', 'account', 'amount', 'stage'], + filter: [ + ['stage', '!=', 'closed_won'], + ['stage', '!=', 'closed_lost'], + ], + gantt: { + startDateField: 'created_date', + endDateField: 'close_date', + titleField: 'name', + progressField: 'probability', + } + } + }, + // Form Views + form_views: { + default: { + type: 'tabbed', + sections: [ + { + label: 'Opportunity Information', + columns: 2, + fields: ['name', 'account', 'primary_contact', 'owner', 'amount', 'close_date'], + }, + { + label: 'Sales Process', + columns: 2, + fields: ['stage', 'probability', 'forecast_category', 'expected_revenue', 'days_in_stage'], + }, + { + label: 'Classification', + columns: 2, + fields: ['type', 'lead_source', 'campaign', 'competitors'], + }, + { + label: 'Details', + columns: 1, + fields: ['description', 'next_step'], + }, + { + label: 'System Information', + columns: 2, + collapsible: true, + collapsed: true, + fields: ['created_date', 'is_private'], + } + ] + } + }, + // Validation Rules + validations: [ + { + name: 'close_date_future', + type: 'script', + severity: 'warning', + message: 'Close date should not be in the past unless opportunity is closed', + condition: 'close_date < TODAY() AND stage != "closed_won" AND stage != "closed_lost"', + }, + { + name: 'amount_positive', + type: 'script', + severity: 'error', + message: 'Amount must be greater than zero', + condition: 'amount <= 0', + }, + { + name: 'stage_progression', + type: 'state_machine', + severity: 'error', + message: 'Invalid stage transition', + field: 'stage', + transitions: { + 'prospecting': ['qualification', 'closed_lost'], + 'qualification': ['needs_analysis', 'closed_lost'], + 'needs_analysis': ['proposal', 'closed_lost'], + 'proposal': ['negotiation', 'closed_lost'], + 'negotiation': ['closed_won', 'closed_lost'], + 'closed_won': [], // Terminal state + 'closed_lost': [] // Terminal state + } + }, + ], + // Workflow Rules + workflows: [ + { + name: 'update_probability_by_stage', + objectName: 'opportunity', + triggerType: 'on_create_or_update', + criteria: 'ISCHANGED(stage)', + active: true, + actions: [ + { + name: 'set_probability', + type: 'field_update', + field: 'probability', + value: `CASE(stage, + "prospecting", 10, + "qualification", 25, + "needs_analysis", 40, + "proposal", 60, + "negotiation", 80, + "closed_won", 100, + "closed_lost", 0, + probability + )`, + }, + { + name: 'set_forecast_category', + type: 'field_update', + field: 'forecast_category', + value: `CASE(stage, + "prospecting", "pipeline", + "qualification", "pipeline", + "needs_analysis", "best_case", + "proposal", "commit", + "negotiation", "commit", + "closed_won", "closed", + "closed_lost", "omitted", + forecast_category + )`, + } + ], + }, + { + name: 'calculate_expected_revenue', + objectName: 'opportunity', + triggerType: 'on_create_or_update', + criteria: 'ISCHANGED(amount) OR ISCHANGED(probability)', + active: true, + actions: [ + { + name: 'update_expected_revenue', + type: 'field_update', + field: 'expected_revenue', + value: 'amount * (probability / 100)', + } + ], + }, + { + name: 'notify_on_large_deal_won', + objectName: 'opportunity', + triggerType: 'on_update', + criteria: 'ISCHANGED(stage) AND stage = "closed_won" AND amount > 100000', + active: true, + actions: [ + { + name: 'notify_management', + type: 'email_alert', + template: 'large_deal_won', + recipients: ['sales_management@example.com'], + } + ], + } + ], +}); diff --git a/examples/crm/src/domains/crm/task.object.d.ts b/examples/crm/src/domains/crm/task.object.d.ts new file mode 100644 index 0000000..672037b --- /dev/null +++ b/examples/crm/src/domains/crm/task.object.d.ts @@ -0,0 +1,1291 @@ +export declare const Task: { + name: string; + label: string; + pluralLabel: string; + icon: string; + description: string; + fields: { + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + description: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "markdown"; + }; + status: { + type: "select"; + label: string; + required: true; + options: ({ + label: string; + value: string; + color: string; + default: true; + } | { + label: string; + value: string; + color: string; + default?: undefined; + })[]; + }; + priority: { + type: "select"; + label: string; + required: true; + options: ({ + label: string; + value: string; + color: string; + default: true; + } | { + label: string; + value: string; + color: string; + default?: undefined; + })[]; + }; + type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + reminder_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + completed_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "datetime"; + }; + owner: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + related_to_account: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_contact: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_opportunity: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_lead: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + related_to_case: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + reference: string; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "lookup"; + }; + is_recurring: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + recurrence_type: { + readonly formula?: string | undefined; + options: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[]; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "select"; + }; + recurrence_interval: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + recurrence_end_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + is_completed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + is_overdue: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + progress_percent: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "percent"; + }; + estimated_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + actual_hours: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "number"; + }; + }; + enable: { + trackHistory: true; + searchable: true; + apiEnabled: true; + files: true; + feedEnabled: true; + trash: true; + }; + nameField: string; + list_views: { + all: { + label: string; + type: string; + columns: string[]; + sort: { + field: string; + order: string; + }[]; + searchableFields: string[]; + }; + my_tasks: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + sort: { + field: string; + order: string; + }[]; + }; + open_tasks: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + overdue_tasks: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + sort: { + field: string; + order: string; + }[]; + }; + today_tasks: { + label: string; + type: string; + columns: string[]; + filter: string[][]; + }; + by_status: { + label: string; + type: string; + columns: string[]; + filter: (string | boolean)[][]; + kanban: { + groupByField: string; + columns: string[]; + }; + }; + calendar: { + label: string; + type: string; + columns: string[]; + calendar: { + startDateField: string; + titleField: string; + colorField: string; + }; + }; + }; + form_views: { + default: { + type: string; + sections: ({ + label: string; + columns: number; + fields: string[]; + collapsible?: undefined; + collapsed?: undefined; + } | { + label: string; + columns: number; + collapsible: boolean; + collapsed: boolean; + fields: string[]; + })[]; + }; + }; + validations: { + name: string; + type: string; + severity: string; + message: string; + condition: string; + }[]; + workflows: ({ + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + field: string; + value: string; + }[]; + } | { + name: string; + objectName: string; + triggerType: string; + criteria: string; + active: boolean; + actions: { + name: string; + type: string; + template: string; + recipients: string[]; + }[]; + })[]; +}; +//# sourceMappingURL=task.object.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/domains/crm/task.object.d.ts.map b/examples/crm/src/domains/crm/task.object.d.ts.map new file mode 100644 index 0000000..4087bac --- /dev/null +++ b/examples/crm/src/domains/crm/task.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"task.object.d.ts","sourceRoot":"","sources":["task.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;qBAoWwuC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAy8tC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwvO,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAhpqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAiwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAikqC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA91E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAwwE,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA9uzC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAq2uC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAxuzC,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA6iJ,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAt1E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA2oS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA9gX,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA3C,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAD53L,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/domains/crm/task.object.js b/examples/crm/src/domains/crm/task.object.js new file mode 100644 index 0000000..6ca0346 --- /dev/null +++ b/examples/crm/src/domains/crm/task.object.js @@ -0,0 +1,330 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Task = void 0; +const spec_1 = require("@objectstack/spec"); +exports.Task = spec_1.ObjectSchema.create({ + name: 'task', + label: 'Task', + pluralLabel: 'Tasks', + icon: 'check-square', + description: 'Activities and to-do items', + fields: { + // Task Information + subject: spec_1.Field.text({ + label: 'Subject', + required: true, + searchable: true, + maxLength: 255, + }), + description: spec_1.Field.markdown({ + label: 'Description', + }), + // Task Management + status: { + type: 'select', + label: 'Status', + required: true, + options: [ + { label: 'Not Started', value: 'not_started', color: '#808080', default: true }, + { label: 'In Progress', value: 'in_progress', color: '#FFA500' }, + { label: 'Waiting', value: 'waiting', color: '#FFD700' }, + { label: 'Completed', value: 'completed', color: '#00AA00' }, + { label: 'Deferred', value: 'deferred', color: '#999999' }, + ] + }, + priority: { + type: 'select', + label: 'Priority', + required: true, + options: [ + { label: 'Low', value: 'low', color: '#4169E1', default: true }, + { label: 'Normal', value: 'normal', color: '#00AA00' }, + { label: 'High', value: 'high', color: '#FFA500' }, + { label: 'Urgent', value: 'urgent', color: '#FF0000' }, + ] + }, + type: spec_1.Field.select(['Call', 'Email', 'Meeting', 'Follow-up', 'Demo', 'Other'], { + label: 'Task Type', + }), + // Dates + due_date: spec_1.Field.date({ + label: 'Due Date', + }), + reminder_date: spec_1.Field.datetime({ + label: 'Reminder Date/Time', + }), + completed_date: spec_1.Field.datetime({ + label: 'Completed Date', + readonly: true, + }), + // Assignment + owner: spec_1.Field.lookup('user', { + label: 'Assigned To', + required: true, + }), + // Related To (Polymorphic relationship - can link to multiple object types) + related_to_type: spec_1.Field.select(['Account', 'Contact', 'Opportunity', 'Lead', 'Case'], { + label: 'Related To Type', + }), + related_to_account: spec_1.Field.lookup('account', { + label: 'Related Account', + }), + related_to_contact: spec_1.Field.lookup('contact', { + label: 'Related Contact', + }), + related_to_opportunity: spec_1.Field.lookup('opportunity', { + label: 'Related Opportunity', + }), + related_to_lead: spec_1.Field.lookup('lead', { + label: 'Related Lead', + }), + related_to_case: spec_1.Field.lookup('case', { + label: 'Related Case', + }), + // Recurrence (for recurring tasks) + is_recurring: spec_1.Field.boolean({ + label: 'Recurring Task', + defaultValue: false, + }), + recurrence_type: spec_1.Field.select(['Daily', 'Weekly', 'Monthly', 'Yearly'], { + label: 'Recurrence Type', + }), + recurrence_interval: spec_1.Field.number({ + label: 'Recurrence Interval', + defaultValue: 1, + min: 1, + }), + recurrence_end_date: spec_1.Field.date({ + label: 'Recurrence End Date', + }), + // Flags + is_completed: spec_1.Field.boolean({ + label: 'Is Completed', + defaultValue: false, + readonly: true, + }), + is_overdue: spec_1.Field.boolean({ + label: 'Is Overdue', + defaultValue: false, + readonly: true, + }), + // Progress + progress_percent: spec_1.Field.percent({ + label: 'Progress (%)', + min: 0, + max: 100, + defaultValue: 0, + }), + // Time tracking + estimated_hours: spec_1.Field.number({ + label: 'Estimated Hours', + scale: 2, + min: 0, + }), + actual_hours: spec_1.Field.number({ + label: 'Actual Hours', + scale: 2, + min: 0, + }), + }, + enable: { + trackHistory: true, + searchable: true, + apiEnabled: true, + files: true, + feedEnabled: true, + trash: true, + }, + nameField: 'subject', + list_views: { + all: { + label: 'All Tasks', + type: 'grid', + columns: ['subject', 'status', 'priority', 'due_date', 'owner'], + sort: [{ field: 'due_date', order: 'asc' }], + searchableFields: ['subject', 'description'], + }, + my_tasks: { + label: 'My Tasks', + type: 'grid', + columns: ['subject', 'status', 'priority', 'due_date', 'related_to_type'], + filter: [['owner', '=', '{current_user}']], + sort: [{ field: 'due_date', order: 'asc' }], + }, + open_tasks: { + label: 'Open Tasks', + type: 'grid', + columns: ['subject', 'priority', 'due_date', 'owner'], + filter: [['is_completed', '=', false]], + sort: [{ field: 'priority', order: 'desc' }], + }, + overdue_tasks: { + label: 'Overdue Tasks', + type: 'grid', + columns: ['subject', 'priority', 'due_date', 'owner'], + filter: [ + ['is_overdue', '=', true], + ['is_completed', '=', false], + ], + sort: [{ field: 'due_date', order: 'asc' }], + }, + today_tasks: { + label: 'Today\'s Tasks', + type: 'grid', + columns: ['subject', 'status', 'priority', 'owner'], + filter: [ + ['due_date', '=', 'TODAY()'], + ], + }, + by_status: { + label: 'Tasks by Status', + type: 'kanban', + columns: ['subject', 'priority', 'due_date'], + filter: [['is_completed', '=', false]], + kanban: { + groupByField: 'status', + columns: ['subject', 'priority', 'due_date', 'owner'], + } + }, + calendar: { + label: 'Task Calendar', + type: 'calendar', + columns: ['subject', 'priority', 'owner'], + calendar: { + startDateField: 'due_date', + titleField: 'subject', + colorField: 'priority', + } + }, + }, + form_views: { + default: { + type: 'simple', + sections: [ + { + label: 'Task Information', + columns: 2, + fields: ['subject', 'status', 'priority', 'type', 'owner'], + }, + { + label: 'Description', + columns: 1, + fields: ['description'], + }, + { + label: 'Dates & Progress', + columns: 2, + fields: ['due_date', 'reminder_date', 'completed_date', 'progress_percent'], + }, + { + label: 'Time Tracking', + columns: 2, + fields: ['estimated_hours', 'actual_hours'], + }, + { + label: 'Related To', + columns: 2, + fields: ['related_to_type', 'related_to_account', 'related_to_contact', 'related_to_opportunity', 'related_to_lead', 'related_to_case'], + }, + { + label: 'Recurrence', + columns: 2, + collapsible: true, + collapsed: true, + fields: ['is_recurring', 'recurrence_type', 'recurrence_interval', 'recurrence_end_date'], + } + ] + } + }, + validations: [ + { + name: 'completed_date_required', + type: 'script', + severity: 'error', + message: 'Completed date is required when status is Completed', + condition: 'status = "completed" AND ISBLANK(completed_date)', + }, + { + name: 'recurrence_fields_required', + type: 'script', + severity: 'error', + message: 'Recurrence type is required for recurring tasks', + condition: 'is_recurring = true AND ISBLANK(recurrence_type)', + }, + { + name: 'related_to_required', + type: 'script', + severity: 'warning', + message: 'At least one related record should be selected', + condition: 'ISBLANK(related_to_account) AND ISBLANK(related_to_contact) AND ISBLANK(related_to_opportunity) AND ISBLANK(related_to_lead) AND ISBLANK(related_to_case)', + }, + ], + workflows: [ + { + name: 'set_completed_flag', + objectName: 'task', + triggerType: 'on_create_or_update', + criteria: 'ISCHANGED(status)', + active: true, + actions: [ + { + name: 'update_completed_flag', + type: 'field_update', + field: 'is_completed', + value: 'status = "completed"', + } + ], + }, + { + name: 'set_completed_date', + objectName: 'task', + triggerType: 'on_update', + criteria: 'ISCHANGED(status) AND status = "completed"', + active: true, + actions: [ + { + name: 'set_date', + type: 'field_update', + field: 'completed_date', + value: 'NOW()', + }, + { + name: 'set_progress', + type: 'field_update', + field: 'progress_percent', + value: '100', + } + ], + }, + { + name: 'check_overdue', + objectName: 'task', + triggerType: 'on_create_or_update', + criteria: 'due_date < TODAY() AND is_completed = false', + active: true, + actions: [ + { + name: 'set_overdue_flag', + type: 'field_update', + field: 'is_overdue', + value: 'true', + } + ], + }, + { + name: 'notify_on_urgent', + objectName: 'task', + triggerType: 'on_create_or_update', + criteria: 'priority = "urgent" AND is_completed = false', + active: true, + actions: [ + { + name: 'email_owner', + type: 'email_alert', + template: 'urgent_task_alert', + recipients: ['{owner.email}'], + } + ], + }, + ], +}); diff --git a/examples/crm/src/server/apis.d.ts b/examples/crm/src/server/apis.d.ts new file mode 100644 index 0000000..8f34b2e --- /dev/null +++ b/examples/crm/src/server/apis.d.ts @@ -0,0 +1,33 @@ +/** + * Custom API: Close Won Opportunities + * A business-specific endpoint that encapsulates complex logic. + * Path: GET /api/v1/crm/stats/pipeline + */ +export declare const PipelineStatsApi: { + name: string; + path: string; + method: "GET"; + summary: string; + description: string; + type: "script"; + target: string; + authRequired: true; + cacheTtl: number; +}; +/** + * Custom API: Quick Lead Conversion (RPC Style) + * Path: POST /api/v1/crm/leads/convert + */ +export declare const LeadConvertApi: { + name: string; + path: string; + method: "POST"; + summary: string; + type: "flow"; + target: string; + inputMapping: { + source: string; + target: string; + }[]; +}; +//# sourceMappingURL=apis.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/server/apis.d.ts.map b/examples/crm/src/server/apis.d.ts.map new file mode 100644 index 0000000..4296e04 --- /dev/null +++ b/examples/crm/src/server/apis.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["apis.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;CAY3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAazB,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/server/apis.js b/examples/crm/src/server/apis.js new file mode 100644 index 0000000..b3278c5 --- /dev/null +++ b/examples/crm/src/server/apis.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LeadConvertApi = exports.PipelineStatsApi = void 0; +const spec_1 = require("@objectstack/spec"); +/** + * Custom API: Close Won Opportunities + * A business-specific endpoint that encapsulates complex logic. + * Path: GET /api/v1/crm/stats/pipeline + */ +exports.PipelineStatsApi = spec_1.ApiEndpoint.create({ + name: 'get_pipeline_stats', + path: '/api/v1/crm/stats/pipeline', + method: 'GET', + summary: 'Get Pipeline Statistics', + description: 'Returns the total value of open opportunities grouped by stage', + type: 'script', + target: 'server/scripts/pipeline_stats.ts', // Hypothetical script path + authRequired: true, + cacheTtl: 300, // Cache for 5 minutes +}); +/** + * Custom API: Quick Lead Conversion (RPC Style) + * Path: POST /api/v1/crm/leads/convert + */ +exports.LeadConvertApi = spec_1.ApiEndpoint.create({ + name: 'lead_convert', + path: '/api/v1/crm/leads/convert', + method: 'POST', + summary: 'Convert Lead to Account/Contact', + type: 'flow', + target: 'flow_lead_conversion_v2', + inputMapping: [ + { source: 'body.leadId', target: 'leadRecordId' }, + { source: 'body.ownerId', target: 'newOwnerId' } + ] +}); diff --git a/examples/crm/src/server/index.d.ts b/examples/crm/src/server/index.d.ts new file mode 100644 index 0000000..e472dd7 --- /dev/null +++ b/examples/crm/src/server/index.d.ts @@ -0,0 +1,2 @@ +export * from './apis'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/server/index.d.ts.map b/examples/crm/src/server/index.d.ts.map new file mode 100644 index 0000000..231884a --- /dev/null +++ b/examples/crm/src/server/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/server/index.js b/examples/crm/src/server/index.js new file mode 100644 index 0000000..5034a79 --- /dev/null +++ b/examples/crm/src/server/index.js @@ -0,0 +1,17 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./apis"), exports); diff --git a/examples/crm/src/ui/actions.d.ts b/examples/crm/src/ui/actions.d.ts new file mode 100644 index 0000000..5648ef4 --- /dev/null +++ b/examples/crm/src/ui/actions.d.ts @@ -0,0 +1,254 @@ +import type { Action } from '@objectstack/spec'; +export declare const ConvertLeadAction: Action; +export declare const CloneOpportunityAction: Action; +export declare const MarkPrimaryContactAction: Action; +export declare const SendEmailAction: Action; +export declare const LogCallAction: Action; +export declare const EscalateCaseAction: Action; +export declare const CloseCaseAction: Action; +export declare const MassUpdateStageAction: Action; +export declare const ExportToCsvAction: Action; +export declare const CreateCampaignAction: Action; +export declare const CrmActions: { + ConvertLeadAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + CloneOpportunityAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + MarkPrimaryContactAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + SendEmailAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + LogCallAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + EscalateCaseAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + CloseCaseAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + MassUpdateStageAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + ExportToCsvAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; + CreateCampaignAction: { + type: "url" | "script" | "api" | "flow" | "modal"; + label: string; + name: string; + refreshAfter: boolean; + location?: any; + params?: { + type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature"; + label: string; + name: string; + required: boolean; + options?: { + value: string; + label: string; + }[] | undefined; + }[] | undefined; + icon?: string | undefined; + target?: string | undefined; + execute?: string | undefined; + visible?: string | undefined; + locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined; + confirmText?: string | undefined; + successMessage?: string | undefined; + }; +}; +//# sourceMappingURL=actions.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/ui/actions.d.ts.map b/examples/crm/src/ui/actions.d.ts.map new file mode 100644 index 0000000..7fddd56 --- /dev/null +++ b/examples/crm/src/ui/actions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,eAAO,MAAM,iBAAiB,EAAE,MAW/B,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,MASpC,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,MAWtC,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,MAS7B,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,MA6B3B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAmBhC,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,MAmB7B,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,MA0BnC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAS/B,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAiBlC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;mBAYgb,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;mBAAD,CAAC;;;;;;;;;;;;;CADvc,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/ui/actions.js b/examples/crm/src/ui/actions.js new file mode 100644 index 0000000..aae29e5 --- /dev/null +++ b/examples/crm/src/ui/actions.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CrmActions = exports.CreateCampaignAction = exports.ExportToCsvAction = exports.MassUpdateStageAction = exports.CloseCaseAction = exports.EscalateCaseAction = exports.LogCallAction = exports.SendEmailAction = exports.MarkPrimaryContactAction = exports.CloneOpportunityAction = exports.ConvertLeadAction = void 0; +// Convert Lead to Account, Contact, and Opportunity +exports.ConvertLeadAction = { + name: 'convert_lead', + label: 'Convert Lead', + icon: 'arrow-right-circle', + type: 'flow', + target: 'lead_conversion_flow', + locations: ['record_header', 'list_item'], + visible: 'status = "qualified" AND is_converted = false', + confirmText: 'Are you sure you want to convert this lead?', + successMessage: 'Lead converted successfully!', + refreshAfter: true, +}; +// Clone Opportunity +exports.CloneOpportunityAction = { + name: 'clone_opportunity', + label: 'Clone Opportunity', + icon: 'copy', + type: 'script', + execute: 'cloneRecord', + locations: ['record_header', 'record_more'], + successMessage: 'Opportunity cloned successfully!', + refreshAfter: true, +}; +// Mark Contact as Primary +exports.MarkPrimaryContactAction = { + name: 'mark_primary', + label: 'Mark as Primary Contact', + icon: 'star', + type: 'script', + execute: 'markAsPrimaryContact', + locations: ['record_header', 'list_item'], + visible: 'is_primary = false', + confirmText: 'Mark this contact as the primary contact for the account?', + successMessage: 'Contact marked as primary!', + refreshAfter: true, +}; +// Send Email to Contact +exports.SendEmailAction = { + name: 'send_email', + label: 'Send Email', + icon: 'mail', + type: 'modal', + target: 'email_composer', + locations: ['record_header', 'list_item'], + visible: 'email_opt_out = false', + refreshAfter: false, +}; +// Log a Call +exports.LogCallAction = { + name: 'log_call', + label: 'Log a Call', + icon: 'phone', + type: 'modal', + target: 'call_log_modal', + locations: ['record_header', 'list_item', 'record_related'], + params: [ + { + name: 'subject', + label: 'Call Subject', + type: 'text', + required: true, + }, + { + name: 'duration', + label: 'Duration (minutes)', + type: 'number', + required: true, + }, + { + name: 'notes', + label: 'Call Notes', + type: 'textarea', + required: false, + } + ], + successMessage: 'Call logged successfully!', + refreshAfter: true, +}; +// Escalate Case +exports.EscalateCaseAction = { + name: 'escalate_case', + label: 'Escalate Case', + icon: 'alert-triangle', + type: 'modal', + target: 'escalate_case_modal', + locations: ['record_header', 'list_item'], + visible: 'is_escalated = false AND is_closed = false', + params: [ + { + name: 'reason', + label: 'Escalation Reason', + type: 'textarea', + required: true, + } + ], + confirmText: 'This will escalate the case to the escalation team. Continue?', + successMessage: 'Case escalated successfully!', + refreshAfter: true, +}; +// Close Case +exports.CloseCaseAction = { + name: 'close_case', + label: 'Close Case', + icon: 'check-circle', + type: 'modal', + target: 'close_case_modal', + locations: ['record_header'], + visible: 'is_closed = false', + params: [ + { + name: 'resolution', + label: 'Resolution', + type: 'textarea', + required: true, + } + ], + confirmText: 'Are you sure you want to close this case?', + successMessage: 'Case closed successfully!', + refreshAfter: true, +}; +// Mass Update Opportunity Stage +exports.MassUpdateStageAction = { + name: 'mass_update_stage', + label: 'Update Stage', + icon: 'layers', + type: 'modal', + target: 'mass_update_stage_modal', + locations: ['list_toolbar'], + params: [ + { + name: 'stage', + label: 'New Stage', + type: 'select', + required: true, + options: [ + { label: 'Prospecting', value: 'prospecting' }, + { label: 'Qualification', value: 'qualification' }, + { label: 'Needs Analysis', value: 'needs_analysis' }, + { label: 'Proposal', value: 'proposal' }, + { label: 'Negotiation', value: 'negotiation' }, + { label: 'Closed Won', value: 'closed_won' }, + { label: 'Closed Lost', value: 'closed_lost' }, + ] + } + ], + successMessage: 'Opportunities updated successfully!', + refreshAfter: true, +}; +// Export to CSV +exports.ExportToCsvAction = { + name: 'export_csv', + label: 'Export to CSV', + icon: 'download', + type: 'script', + execute: 'exportToCSV', + locations: ['list_toolbar'], + successMessage: 'Export completed!', + refreshAfter: false, +}; +// Create Campaign from Leads +exports.CreateCampaignAction = { + name: 'create_campaign', + label: 'Add to Campaign', + icon: 'send', + type: 'modal', + target: 'add_to_campaign_modal', + locations: ['list_toolbar'], + params: [ + { + name: 'campaign', + label: 'Campaign', + type: 'lookup', + required: true, + } + ], + successMessage: 'Leads added to campaign!', + refreshAfter: true, +}; +exports.CrmActions = { + ConvertLeadAction: exports.ConvertLeadAction, + CloneOpportunityAction: exports.CloneOpportunityAction, + MarkPrimaryContactAction: exports.MarkPrimaryContactAction, + SendEmailAction: exports.SendEmailAction, + LogCallAction: exports.LogCallAction, + EscalateCaseAction: exports.EscalateCaseAction, + CloseCaseAction: exports.CloseCaseAction, + MassUpdateStageAction: exports.MassUpdateStageAction, + ExportToCsvAction: exports.ExportToCsvAction, + CreateCampaignAction: exports.CreateCampaignAction, +}; diff --git a/examples/crm/src/ui/dashboards.d.ts b/examples/crm/src/ui/dashboards.d.ts new file mode 100644 index 0000000..9b57c4d --- /dev/null +++ b/examples/crm/src/ui/dashboards.d.ts @@ -0,0 +1,70 @@ +import type { Dashboard } from '@objectstack/spec'; +export declare const SalesDashboard: Dashboard; +export declare const ServiceDashboard: Dashboard; +export declare const ExecutiveDashboard: Dashboard; +export declare const CrmDashboards: { + SalesDashboard: { + label: string; + name: string; + widgets: { + type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table"; + aggregate: "min" | "max" | "count" | "sum" | "avg"; + layout: { + x: number; + y: number; + w: number; + h: number; + }; + object?: string | undefined; + filter?: import("@objectstack/spec").FilterCondition | undefined; + options?: any; + title?: string | undefined; + categoryField?: string | undefined; + valueField?: string | undefined; + }[]; + description?: string | undefined; + }; + ServiceDashboard: { + label: string; + name: string; + widgets: { + type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table"; + aggregate: "min" | "max" | "count" | "sum" | "avg"; + layout: { + x: number; + y: number; + w: number; + h: number; + }; + object?: string | undefined; + filter?: import("@objectstack/spec").FilterCondition | undefined; + options?: any; + title?: string | undefined; + categoryField?: string | undefined; + valueField?: string | undefined; + }[]; + description?: string | undefined; + }; + ExecutiveDashboard: { + label: string; + name: string; + widgets: { + type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table"; + aggregate: "min" | "max" | "count" | "sum" | "avg"; + layout: { + x: number; + y: number; + w: number; + h: number; + }; + object?: string | undefined; + filter?: import("@objectstack/spec").FilterCondition | undefined; + options?: any; + title?: string | undefined; + categoryField?: string | undefined; + valueField?: string | undefined; + }[]; + description?: string | undefined; + }; +}; +//# sourceMappingURL=dashboards.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/ui/dashboards.d.ts.map b/examples/crm/src/ui/dashboards.d.ts.map new file mode 100644 index 0000000..cf25faa --- /dev/null +++ b/examples/crm/src/ui/dashboards.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dashboards.d.ts","sourceRoot":"","sources":["dashboards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,eAAO,MAAM,cAAc,EAAE,SAsI5B,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,SA4H9B,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,SAgIhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;kBA5IY,CAAC;kBAC/B,CAAC;mBAIL,CAAD;iBAIK,CAAC;yBACoB,CAAC;sBACP,CAAC;;;;;;;;;;;;;;;;kBAXc,CAAC;kBAC/B,CAAC;mBAIL,CAAD;iBAIK,CAAC;yBACoB,CAAC;sBACP,CAAC;;;;;;;;;;;;;;;;kBAXc,CAAC;kBAC/B,CAAC;mBAIL,CAAD;iBAIK,CAAC;yBACoB,CAAC;sBACP,CAAC;;;;CAqIvB,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/ui/dashboards.js b/examples/crm/src/ui/dashboards.js new file mode 100644 index 0000000..9fd0fe8 --- /dev/null +++ b/examples/crm/src/ui/dashboards.js @@ -0,0 +1,391 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CrmDashboards = exports.ExecutiveDashboard = exports.ServiceDashboard = exports.SalesDashboard = void 0; +// Sales Performance Dashboard +exports.SalesDashboard = { + name: 'sales_dashboard', + label: 'Sales Performance', + description: 'Key sales metrics and pipeline overview', + widgets: [ + // Row 1: Key Metrics + { + title: 'Total Pipeline Value', + type: 'metric', + object: 'opportunity', + filter: { + stage: { $nin: ['closed_won', 'closed_lost'] } + }, + valueField: 'amount', + aggregate: 'sum', + layout: { x: 0, y: 0, w: 3, h: 2 }, + options: { + prefix: '$', + color: '#4169E1', + } + }, + { + title: 'Closed Won This Quarter', + type: 'metric', + object: 'opportunity', + filter: { + stage: 'closed_won', + close_date: { $gte: '{current_quarter_start}' } + }, + valueField: 'amount', + aggregate: 'sum', + layout: { x: 3, y: 0, w: 3, h: 2 }, + options: { + prefix: '$', + color: '#00AA00', + } + }, + { + title: 'Open Opportunities', + type: 'metric', + object: 'opportunity', + filter: { + stage: { $nin: ['closed_won', 'closed_lost'] } + }, + aggregate: 'count', + layout: { x: 6, y: 0, w: 3, h: 2 }, + options: { + color: '#FFA500', + } + }, + { + title: 'Win Rate', + type: 'metric', + object: 'opportunity', + filter: { + close_date: { $gte: '{current_quarter_start}' } + }, + valueField: 'stage', + aggregate: 'count', + layout: { x: 9, y: 0, w: 3, h: 2 }, + options: { + suffix: '%', + color: '#9370DB', + } + }, + // Row 2: Pipeline Analysis + { + title: 'Pipeline by Stage', + type: 'funnel', + object: 'opportunity', + filter: { + stage: { $nin: ['closed_won', 'closed_lost'] } + }, + categoryField: 'stage', + valueField: 'amount', + aggregate: 'sum', + layout: { x: 0, y: 2, w: 6, h: 4 }, + options: { + showValues: true, + } + }, + { + title: 'Opportunities by Owner', + type: 'bar', + object: 'opportunity', + filter: { + stage: { $nin: ['closed_won', 'closed_lost'] } + }, + categoryField: 'owner', + valueField: 'amount', + aggregate: 'sum', + layout: { x: 6, y: 2, w: 6, h: 4 }, + options: { + horizontal: true, + } + }, + // Row 3: Trends + { + title: 'Monthly Revenue Trend', + type: 'line', + object: 'opportunity', + filter: { + stage: 'closed_won', + close_date: { $gte: '{last_12_months}' } + }, + categoryField: 'close_date', + valueField: 'amount', + aggregate: 'sum', + layout: { x: 0, y: 6, w: 8, h: 4 }, + options: { + dateGranularity: 'month', + showTrend: true, + } + }, + { + title: 'Top Opportunities', + type: 'table', + object: 'opportunity', + filter: { + stage: { $nin: ['closed_won', 'closed_lost'] } + }, + aggregate: 'count', + layout: { x: 8, y: 6, w: 4, h: 4 }, + options: { + columns: ['name', 'amount', 'stage', 'close_date'], + sortBy: 'amount', + sortOrder: 'desc', + limit: 10, + } + }, + ] +}; +// Customer Service Dashboard +exports.ServiceDashboard = { + name: 'service_dashboard', + label: 'Customer Service', + description: 'Support case metrics and performance', + widgets: [ + // Row 1: Key Metrics + { + title: 'Open Cases', + type: 'metric', + object: 'case', + filter: { is_closed: false }, + aggregate: 'count', + layout: { x: 0, y: 0, w: 3, h: 2 }, + options: { + color: '#FFA500', + } + }, + { + title: 'Critical Cases', + type: 'metric', + object: 'case', + filter: { + priority: 'critical', + is_closed: false + }, + aggregate: 'count', + layout: { x: 3, y: 0, w: 3, h: 2 }, + options: { + color: '#FF0000', + } + }, + { + title: 'Avg Resolution Time (hrs)', + type: 'metric', + object: 'case', + filter: { is_closed: true }, + valueField: 'resolution_time_hours', + aggregate: 'avg', + layout: { x: 6, y: 0, w: 3, h: 2 }, + options: { + suffix: 'h', + color: '#4169E1', + } + }, + { + title: 'SLA Violations', + type: 'metric', + object: 'case', + filter: { is_sla_violated: true }, + aggregate: 'count', + layout: { x: 9, y: 0, w: 3, h: 2 }, + options: { + color: '#FF4500', + } + }, + // Row 2: Case Distribution + { + title: 'Cases by Status', + type: 'donut', + object: 'case', + filter: { is_closed: false }, + categoryField: 'status', + aggregate: 'count', + layout: { x: 0, y: 2, w: 4, h: 4 }, + options: { + showLegend: true, + } + }, + { + title: 'Cases by Priority', + type: 'pie', + object: 'case', + filter: { is_closed: false }, + categoryField: 'priority', + aggregate: 'count', + layout: { x: 4, y: 2, w: 4, h: 4 }, + options: { + showLegend: true, + } + }, + { + title: 'Cases by Origin', + type: 'bar', + object: 'case', + categoryField: 'origin', + aggregate: 'count', + layout: { x: 8, y: 2, w: 4, h: 4 }, + }, + // Row 3: Trends and Lists + { + title: 'Daily Case Volume', + type: 'line', + object: 'case', + filter: { + created_date: { $gte: '{last_30_days}' } + }, + categoryField: 'created_date', + aggregate: 'count', + layout: { x: 0, y: 6, w: 8, h: 4 }, + options: { + dateGranularity: 'day', + } + }, + { + title: 'My Open Cases', + type: 'table', + object: 'case', + filter: { + owner: '{current_user}', + is_closed: false + }, + aggregate: 'count', + layout: { x: 8, y: 6, w: 4, h: 4 }, + options: { + columns: ['case_number', 'subject', 'priority', 'status'], + sortBy: 'priority', + sortOrder: 'desc', + limit: 10, + } + }, + ] +}; +// Executive Dashboard +exports.ExecutiveDashboard = { + name: 'executive_dashboard', + label: 'Executive Overview', + description: 'High-level business metrics', + widgets: [ + // Row 1: Revenue Metrics + { + title: 'Total Revenue (YTD)', + type: 'metric', + object: 'opportunity', + filter: { + stage: 'closed_won', + close_date: { $gte: '{current_year_start}' } + }, + valueField: 'amount', + aggregate: 'sum', + layout: { x: 0, y: 0, w: 3, h: 2 }, + options: { + prefix: '$', + color: '#00AA00', + } + }, + { + title: 'Total Accounts', + type: 'metric', + object: 'account', + filter: { is_active: true }, + aggregate: 'count', + layout: { x: 3, y: 0, w: 3, h: 2 }, + options: { + color: '#4169E1', + } + }, + { + title: 'Total Contacts', + type: 'metric', + object: 'contact', + aggregate: 'count', + layout: { x: 6, y: 0, w: 3, h: 2 }, + options: { + color: '#9370DB', + } + }, + { + title: 'Total Leads', + type: 'metric', + object: 'lead', + filter: { is_converted: false }, + aggregate: 'count', + layout: { x: 9, y: 0, w: 3, h: 2 }, + options: { + color: '#FFA500', + } + }, + // Row 2: Revenue Analysis + { + title: 'Revenue by Industry', + type: 'bar', + object: 'opportunity', + filter: { + stage: 'closed_won', + close_date: { $gte: '{current_year_start}' } + }, + categoryField: 'account.industry', + valueField: 'amount', + aggregate: 'sum', + layout: { x: 0, y: 2, w: 6, h: 4 }, + }, + { + title: 'Quarterly Revenue Trend', + type: 'line', + object: 'opportunity', + filter: { + stage: 'closed_won', + close_date: { $gte: '{last_4_quarters}' } + }, + categoryField: 'close_date', + valueField: 'amount', + aggregate: 'sum', + layout: { x: 6, y: 2, w: 6, h: 4 }, + options: { + dateGranularity: 'quarter', + } + }, + // Row 3: Customer & Activity Metrics + { + title: 'New Accounts by Month', + type: 'bar', + object: 'account', + filter: { + created_date: { $gte: '{last_6_months}' } + }, + categoryField: 'created_date', + aggregate: 'count', + layout: { x: 0, y: 6, w: 4, h: 4 }, + options: { + dateGranularity: 'month', + } + }, + { + title: 'Lead Conversion Rate', + type: 'metric', + object: 'lead', + valueField: 'is_converted', + aggregate: 'avg', + layout: { x: 4, y: 6, w: 4, h: 4 }, + options: { + suffix: '%', + color: '#00AA00', + } + }, + { + title: 'Top Accounts by Revenue', + type: 'table', + object: 'account', + aggregate: 'count', + layout: { x: 8, y: 6, w: 4, h: 4 }, + options: { + columns: ['name', 'annual_revenue', 'type'], + sortBy: 'annual_revenue', + sortOrder: 'desc', + limit: 10, + } + }, + ] +}; +exports.CrmDashboards = { + SalesDashboard: exports.SalesDashboard, + ServiceDashboard: exports.ServiceDashboard, + ExecutiveDashboard: exports.ExecutiveDashboard, +}; diff --git a/examples/crm/src/ui/reports.d.ts b/examples/crm/src/ui/reports.d.ts new file mode 100644 index 0000000..7a14011 --- /dev/null +++ b/examples/crm/src/ui/reports.d.ts @@ -0,0 +1,252 @@ +import type { Report } from '@objectstack/spec'; +export declare const OpportunitiesByStageReport: Report; +export declare const WonOpportunitiesByOwnerReport: Report; +export declare const AccountsByIndustryTypeReport: Report; +export declare const CasesByStatusPriorityReport: Report; +export declare const SlaPerformanceReport: Report; +export declare const LeadsBySourceReport: Report; +export declare const ContactsByAccountReport: Report; +export declare const TasksByOwnerReport: Report; +export declare const CrmReports: { + OpportunitiesByStageReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + WonOpportunitiesByOwnerReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + AccountsByIndustryTypeReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + CasesByStatusPriorityReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + SlaPerformanceReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + LeadsBySourceReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + ContactsByAccountReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; + TasksByOwnerReport: { + type: "summary" | "tabular" | "matrix" | "joined"; + label: string; + name: string; + objectName: string; + columns: { + field: string; + label?: string | undefined; + aggregate?: "unique" | "min" | "max" | "count" | "sum" | "avg" | undefined; + }[]; + filter?: import("@objectstack/spec").FilterCondition | undefined; + description?: string | undefined; + groupingsDown?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + groupingsAcross?: { + field: string; + sortOrder: "asc" | "desc"; + dateGranularity?: "day" | "week" | "month" | "quarter" | "year" | undefined; + }[] | undefined; + chart?: { + type: "bar" | "line" | "pie" | "donut" | "funnel" | "column" | "scatter"; + showLegend: boolean; + xAxis: string; + yAxis: string; + title?: string | undefined; + } | undefined; + }; +}; +//# sourceMappingURL=reports.d.ts.map \ No newline at end of file diff --git a/examples/crm/src/ui/reports.d.ts.map b/examples/crm/src/ui/reports.d.ts.map new file mode 100644 index 0000000..779a07f --- /dev/null +++ b/examples/crm/src/ui/reports.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["reports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,eAAO,MAAM,0BAA0B,EAAE,MAoDxC,CAAC;AAGF,eAAO,MAAM,6BAA6B,EAAE,MA8C3C,CAAC;AAGF,eAAO,MAAM,4BAA4B,EAAE,MAoC1C,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,MAkDzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MA2ClC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,MA6CjC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,MAqCrC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MA0ChC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;iBAjFuB,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;;;;;;;;iBAnDgC,CAAC;qBAG3C,CAAC;;;;;;;2BAoBe,CAAC;;;;;2BAcX,CAAC;;;;;;;iBAcE,CAAC;;;CAuCb,CAAC"} \ No newline at end of file diff --git a/examples/crm/src/ui/reports.js b/examples/crm/src/ui/reports.js new file mode 100644 index 0000000..0e528d3 --- /dev/null +++ b/examples/crm/src/ui/reports.js @@ -0,0 +1,344 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CrmReports = exports.TasksByOwnerReport = exports.ContactsByAccountReport = exports.LeadsBySourceReport = exports.SlaPerformanceReport = exports.CasesByStatusPriorityReport = exports.AccountsByIndustryTypeReport = exports.WonOpportunitiesByOwnerReport = exports.OpportunitiesByStageReport = void 0; +// Sales Report - Opportunities by Stage +exports.OpportunitiesByStageReport = { + name: 'opportunities_by_stage', + label: 'Opportunities by Stage', + description: 'Summary of opportunities grouped by stage', + objectName: 'opportunity', + type: 'summary', + columns: [ + { + field: 'name', + label: 'Opportunity Name', + }, + { + field: 'account', + label: 'Account', + }, + { + field: 'amount', + label: 'Amount', + aggregate: 'sum', + }, + { + field: 'close_date', + label: 'Close Date', + }, + { + field: 'probability', + label: 'Probability', + aggregate: 'avg', + }, + ], + groupingsDown: [ + { + field: 'stage', + sortOrder: 'asc', + } + ], + filter: { + stage: { $ne: 'closed_lost' }, + close_date: { $gte: '{current_year_start}' } + }, + chart: { + type: 'bar', + title: 'Pipeline by Stage', + showLegend: true, + xAxis: 'stage', + yAxis: 'amount', + } +}; +// Sales Report - Won Opportunities by Owner +exports.WonOpportunitiesByOwnerReport = { + name: 'won_opportunities_by_owner', + label: 'Won Opportunities by Owner', + description: 'Closed won opportunities grouped by owner', + objectName: 'opportunity', + type: 'summary', + columns: [ + { + field: 'name', + label: 'Opportunity Name', + }, + { + field: 'account', + label: 'Account', + }, + { + field: 'amount', + label: 'Amount', + aggregate: 'sum', + }, + { + field: 'close_date', + label: 'Close Date', + }, + ], + groupingsDown: [ + { + field: 'owner', + sortOrder: 'desc', + } + ], + filter: { + stage: 'closed_won' + }, + chart: { + type: 'column', + title: 'Revenue by Sales Rep', + showLegend: false, + xAxis: 'owner', + yAxis: 'amount', + } +}; +// Account Report - Accounts by Industry and Type (Matrix) +exports.AccountsByIndustryTypeReport = { + name: 'accounts_by_industry_type', + label: 'Accounts by Industry and Type', + description: 'Matrix report showing accounts by industry and type', + objectName: 'account', + type: 'matrix', + columns: [ + { + field: 'name', + aggregate: 'count', + }, + { + field: 'annual_revenue', + aggregate: 'sum', + }, + ], + groupingsDown: [ + { + field: 'industry', + sortOrder: 'asc', + } + ], + groupingsAcross: [ + { + field: 'type', + sortOrder: 'asc', + } + ], + filter: { + is_active: true + }, +}; +// Support Report - Cases by Status and Priority +exports.CasesByStatusPriorityReport = { + name: 'cases_by_status_priority', + label: 'Cases by Status and Priority', + description: 'Summary of cases by status and priority', + objectName: 'case', + type: 'summary', + columns: [ + { + field: 'case_number', + label: 'Case Number', + }, + { + field: 'subject', + label: 'Subject', + }, + { + field: 'account', + label: 'Account', + }, + { + field: 'owner', + label: 'Owner', + }, + { + field: 'resolution_time_hours', + label: 'Resolution Time', + aggregate: 'avg', + }, + ], + groupingsDown: [ + { + field: 'status', + sortOrder: 'asc', + }, + { + field: 'priority', + sortOrder: 'desc', + } + ], + chart: { + type: 'bar', + title: 'Cases by Status', + showLegend: true, + xAxis: 'status', + yAxis: 'case_number', + } +}; +// Support Report - SLA Performance +exports.SlaPerformanceReport = { + name: 'sla_performance', + label: 'SLA Performance Report', + description: 'Analysis of SLA compliance', + objectName: 'case', + type: 'summary', + columns: [ + { + field: 'case_number', + aggregate: 'count', + }, + { + field: 'is_sla_violated', + label: 'SLA Violated', + aggregate: 'count', + }, + { + field: 'resolution_time_hours', + label: 'Avg Resolution Time', + aggregate: 'avg', + }, + ], + groupingsDown: [ + { + field: 'priority', + sortOrder: 'desc', + } + ], + filter: { + is_closed: true + }, + chart: { + type: 'column', + title: 'SLA Violations by Priority', + showLegend: false, + xAxis: 'priority', + yAxis: 'is_sla_violated', + } +}; +// Lead Report - Leads by Source and Status +exports.LeadsBySourceReport = { + name: 'leads_by_source', + label: 'Leads by Source and Status', + description: 'Lead pipeline analysis', + objectName: 'lead', + type: 'summary', + columns: [ + { + field: 'full_name', + label: 'Name', + }, + { + field: 'company', + label: 'Company', + }, + { + field: 'rating', + label: 'Rating', + }, + ], + groupingsDown: [ + { + field: 'lead_source', + sortOrder: 'asc', + }, + { + field: 'status', + sortOrder: 'asc', + } + ], + filter: { + is_converted: false + }, + chart: { + type: 'pie', + title: 'Leads by Source', + showLegend: true, + xAxis: 'lead_source', + yAxis: 'full_name', + } +}; +// Contact Report - Contacts by Account +exports.ContactsByAccountReport = { + name: 'contacts_by_account', + label: 'Contacts by Account', + description: 'List of contacts grouped by account', + objectName: 'contact', + type: 'summary', + columns: [ + { + field: 'full_name', + label: 'Name', + }, + { + field: 'title', + label: 'Title', + }, + { + field: 'email', + label: 'Email', + }, + { + field: 'phone', + label: 'Phone', + }, + { + field: 'is_primary', + label: 'Primary Contact', + }, + ], + groupingsDown: [ + { + field: 'account', + sortOrder: 'asc', + } + ], +}; +// Activity Report - Tasks by Owner +exports.TasksByOwnerReport = { + name: 'tasks_by_owner', + label: 'Tasks by Owner', + description: 'Task summary by owner', + objectName: 'task', + type: 'summary', + columns: [ + { + field: 'subject', + label: 'Subject', + }, + { + field: 'status', + label: 'Status', + }, + { + field: 'priority', + label: 'Priority', + }, + { + field: 'due_date', + label: 'Due Date', + }, + { + field: 'actual_hours', + label: 'Hours', + aggregate: 'sum', + }, + ], + groupingsDown: [ + { + field: 'owner', + sortOrder: 'asc', + } + ], + filter: { + is_completed: false + }, +}; +exports.CrmReports = { + OpportunitiesByStageReport: exports.OpportunitiesByStageReport, + WonOpportunitiesByOwnerReport: exports.WonOpportunitiesByOwnerReport, + AccountsByIndustryTypeReport: exports.AccountsByIndustryTypeReport, + CasesByStatusPriorityReport: exports.CasesByStatusPriorityReport, + SlaPerformanceReport: exports.SlaPerformanceReport, + LeadsBySourceReport: exports.LeadsBySourceReport, + ContactsByAccountReport: exports.ContactsByAccountReport, + TasksByOwnerReport: exports.TasksByOwnerReport, +}; diff --git a/examples/host/debug-registry.d.ts b/examples/host/debug-registry.d.ts new file mode 100644 index 0000000..2d01480 --- /dev/null +++ b/examples/host/debug-registry.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=debug-registry.d.ts.map \ No newline at end of file diff --git a/examples/host/debug-registry.d.ts.map b/examples/host/debug-registry.d.ts.map new file mode 100644 index 0000000..f4e235a --- /dev/null +++ b/examples/host/debug-registry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"debug-registry.d.ts","sourceRoot":"","sources":["debug-registry.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/examples/host/debug-registry.js b/examples/host/debug-registry.js new file mode 100644 index 0000000..206e087 --- /dev/null +++ b/examples/host/debug-registry.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const runtime_1 = require("@objectstack/runtime"); +const objectql_1 = require("@objectstack/objectql"); +const driver_memory_1 = require("@objectstack/driver-memory"); +const objectstack_config_1 = __importDefault(require("@objectstack/example-todo/objectstack.config")); +(async () => { + console.log('--- Debug Registry ---'); + console.log('Apps:', [objectstack_config_1.default.name]); + console.log('Objects inside App:', objectstack_config_1.default.objects?.map((o) => o.name)); + const kernel = new runtime_1.ObjectStackKernel([ + objectstack_config_1.default, + new driver_memory_1.InMemoryDriver() + ]); + await kernel.start(); + console.log('--- Post Start ---'); + // Check Registry directly + const obj = objectql_1.SchemaRegistry.getObject('todo_task'); + console.log('Registry "todo_task":', obj ? 'FOUND' : 'MISSING'); + // Check Registry via Engine + try { + // Access private engine map if possible or simulate query + // The engine doesn't expose a 'hasObject' method easily, but we can inspect internal logic + // Actually SchemaRegistry is static, so if it's there, it's there. + } + catch (e) { + console.error(e); + } +})(); diff --git a/examples/host/src/index.d.ts b/examples/host/src/index.d.ts new file mode 100644 index 0000000..e26a57a --- /dev/null +++ b/examples/host/src/index.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/examples/host/src/index.d.ts.map b/examples/host/src/index.d.ts.map new file mode 100644 index 0000000..82335e7 --- /dev/null +++ b/examples/host/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/examples/host/src/index.js b/examples/host/src/index.js new file mode 100644 index 0000000..90cb043 --- /dev/null +++ b/examples/host/src/index.js @@ -0,0 +1,26 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const runtime_1 = require("@objectstack/runtime"); +const driver_memory_1 = require("@objectstack/driver-memory"); +const plugin_hono_server_1 = require("@objectstack/plugin-hono-server"); +const objectstack_config_1 = __importDefault(require("@objectstack/example-crm/objectstack.config")); +const objectstack_config_2 = __importDefault(require("@objectstack/example-todo/objectstack.config")); +const objectstack_config_3 = __importDefault(require("@objectstack/plugin-bi/objectstack.config")); +(async () => { + console.log('šŸš€ Booting Kernel...'); + const kernel = new runtime_1.ObjectStackKernel([ + objectstack_config_1.default, + objectstack_config_2.default, + objectstack_config_3.default, + new driver_memory_1.InMemoryDriver(), + // Load the Hono Server Plugin + new plugin_hono_server_1.HonoServerPlugin({ + port: 3004, + staticRoot: './public' + }) + ]); + await kernel.start(); +})(); diff --git a/examples/plugin-bi/objectstack.config.d.ts b/examples/plugin-bi/objectstack.config.d.ts new file mode 100644 index 0000000..f4b2baf --- /dev/null +++ b/examples/plugin-bi/objectstack.config.d.ts @@ -0,0 +1,4 @@ +import { ObjectStackManifest } from '@objectstack/spec'; +declare const BiPlugin: ObjectStackManifest; +export default BiPlugin; +//# sourceMappingURL=objectstack.config.d.ts.map \ No newline at end of file diff --git a/examples/plugin-bi/objectstack.config.d.ts.map b/examples/plugin-bi/objectstack.config.d.ts.map new file mode 100644 index 0000000..741687b --- /dev/null +++ b/examples/plugin-bi/objectstack.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectstack.config.d.ts","sourceRoot":"","sources":["objectstack.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,QAAA,MAAM,QAAQ,EAAE,mBA4Df,CAAC;AAEF,eAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/examples/plugin-bi/objectstack.config.js b/examples/plugin-bi/objectstack.config.js new file mode 100644 index 0000000..6bc66e8 --- /dev/null +++ b/examples/plugin-bi/objectstack.config.js @@ -0,0 +1,61 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const BiPlugin = { + id: 'com.objectstack.bi', + name: 'Business Intelligence Plugin', + version: '1.0.0', + type: 'plugin', + description: 'Provides BI capabilities, dataset definitions, and chart rendering.', + // 1. Configuration (Settings) + configuration: { + title: 'BI Plugin Configuration', + properties: { + enableCache: { + type: 'boolean', + default: true, + description: 'Enable in-memory caching for query results' + }, + maxRows: { + type: 'number', + default: 1000, + description: 'Maximum rows returned per query' + } + } + }, + // 2. Capabilities + contributes: { + kinds: [ + { + id: 'bi.dataset', + globs: ['**/*.dataset.json', '**/*.dataset.ts'], + description: 'BI Dataset Definition' + }, + { + id: 'bi.dashboard', + globs: ['**/*.bi-dash.json'], + description: 'Advanced BI Dashboard' + } + ], + menus: { + 'sidebar/tools': [ + { id: 'open_bi_studio', label: 'BI Studio', command: 'bi.openStudio' } + ] + }, + actions: [ + { + name: 'refresh_dataset', + label: 'Refresh Dataset', + description: 'Manually trigger a dataset refresh', + input: { datasetId: 'string' } + } + ] + }, + // 3. Lifecycle Entry Point + // in a real scenario, this would be a path or module name + extensions: { + runtime: { + entry: './src/index.ts' + } + } +}; +exports.default = BiPlugin; diff --git a/examples/plugin-bi/src/index.d.ts b/examples/plugin-bi/src/index.d.ts new file mode 100644 index 0000000..990dac3 --- /dev/null +++ b/examples/plugin-bi/src/index.d.ts @@ -0,0 +1,11 @@ +import { PluginDefinition } from '@objectstack/spec'; +export declare class BiEngine { + constructor(); + registerDataset(path: string): void; + runQuery(query: string): { + result: string; + }; +} +declare const plugin: PluginDefinition; +export default plugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/examples/plugin-bi/src/index.d.ts.map b/examples/plugin-bi/src/index.d.ts.map new file mode 100644 index 0000000..c0e60c6 --- /dev/null +++ b/examples/plugin-bi/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,mBAAmB,CAAC;AAExE,qBAAa,QAAQ;;IAKnB,eAAe,CAAC,IAAI,EAAE,MAAM;IAI5B,QAAQ,CAAC,KAAK,EAAE,MAAM;;;CAIvB;AAED,QAAA,MAAM,MAAM,EAAE,gBA2Cb,CAAC;AAEF,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/examples/plugin-bi/src/index.js b/examples/plugin-bi/src/index.js new file mode 100644 index 0000000..a816ba0 --- /dev/null +++ b/examples/plugin-bi/src/index.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BiEngine = void 0; +class BiEngine { + constructor() { + console.log('[BI Plugin] Engine Initialized'); + } + registerDataset(path) { + console.log(`[BI Plugin] Registered dataset: ${path}`); + } + runQuery(query) { + console.log(`[BI Plugin] Running Query: ${query}`); + return { result: 'Mock Data' }; + } +} +exports.BiEngine = BiEngine; +const plugin = { + id: 'com.objectstack.bi', + version: '1.0.0', + onEnable: async (context) => { + // 1. Destructure strict APIs + const { logger, ql, os, app, storage, i18n } = context; + logger.info('[BI Plugin] Enabling BI Plugin...'); + // 2. Use Configuration + const config = await os.getConfig('com.objectstack.bi'); + if (config?.enableCache) { + logger.info('Caching Enabled'); + } + // 3. Register Service + const engine = new BiEngine(); + // Access runtime capabilities not in strict schema + // In a real implementation module augmentation would be used + const runtime = context; + if (runtime.services) { + runtime.services.register('bi.engine', engine); + } + // 4. Register Route + app.router.get('/bi/status', async () => { + return { status: 'running', engine: 'v1' }; + }); + // 5. Use Storage + await storage.set('started_at', Date.now()); + // 6. Demonstrate i18n & Data Access + // (In a real app, this would be used in a route or job) + if (Date.now() % 1000 === 0) { + console.log(i18n.t('hello_world', {})); + await ql.object('account').query('SELECT count() FROM account'); + } + logger.info('[BI Plugin] Services registered.'); + } +}; +exports.default = plugin; diff --git a/examples/todo/objectstack.config.d.ts b/examples/todo/objectstack.config.d.ts new file mode 100644 index 0000000..4cdf52c --- /dev/null +++ b/examples/todo/objectstack.config.d.ts @@ -0,0 +1,408 @@ +declare const _default: { + name: string; + label: string; + description: string; + version: string; + icon: string; + branding: { + primaryColor: string; + logo: string; + }; + objects: { + name: string; + label: string; + icon: string; + nameField: string; + enable: { + apiEnabled: true; + trackHistory: true; + }; + fields: { + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + is_completed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + priority: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + category_color: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "color"; + }; + code_snippet: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + language: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "code"; + }; + notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "richtext"; + }; + }; + }[]; + navigation: { + id: string; + type: string; + label: string; + children: { + id: string; + type: string; + objectName: string; + label: string; + }[]; + }[]; + data: { + object: string; + mode: string; + records: ({ + subject: string; + is_completed: boolean; + priority: number; + due_date: Date; + } | { + subject: string; + is_completed: boolean; + priority: number; + due_date?: undefined; + })[]; + }[]; +}; +export default _default; +//# sourceMappingURL=objectstack.config.d.ts.map \ No newline at end of file diff --git a/examples/todo/objectstack.config.d.ts.map b/examples/todo/objectstack.config.d.ts.map new file mode 100644 index 0000000..ae57678 --- /dev/null +++ b/examples/todo/objectstack.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"objectstack.config.d.ts","sourceRoot":"","sources":["objectstack.config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;yBA2CgsS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAuoS,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAt1E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAiuzD,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA12E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA10E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA12E,CAAC;2BAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxCj+lE,wBAuCG"} \ No newline at end of file diff --git a/examples/todo/objectstack.config.js b/examples/todo/objectstack.config.js new file mode 100644 index 0000000..3f6ca76 --- /dev/null +++ b/examples/todo/objectstack.config.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const spec_1 = require("@objectstack/spec"); +const task_object_1 = require("./src/domains/todo/task.object"); +exports.default = spec_1.App.create({ + name: 'todo_app', + label: 'Todo App', + description: 'A simple Todo example demonstrating ObjectStack Protocol', + version: '1.0.0', + icon: 'check-square', + branding: { + primaryColor: '#10B981', + logo: '/assets/todo-logo.png', + }, + objects: [ + task_object_1.TodoTask + ], + navigation: [ + { + id: 'group_tasks', + type: 'group', + label: 'Tasks', + children: [ + { + id: 'nav_todo_task', + type: 'object', + objectName: 'todo_task', + label: 'My Tasks' + } + ] + } + ], + data: [ + { + object: 'todo_task', + mode: 'upsert', + records: [ + { subject: 'Review PR #102', is_completed: true, priority: 3, due_date: new Date() }, + { subject: 'Write Documentation', is_completed: false, priority: 2, due_date: new Date(Date.now() + 86400000) }, + { subject: 'Fix specific Server bug', is_completed: false, priority: 1 } + ] + } + ] +}); diff --git a/examples/todo/src/client-test.d.ts b/examples/todo/src/client-test.d.ts new file mode 100644 index 0000000..b8900bd --- /dev/null +++ b/examples/todo/src/client-test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=client-test.d.ts.map \ No newline at end of file diff --git a/examples/todo/src/client-test.d.ts.map b/examples/todo/src/client-test.d.ts.map new file mode 100644 index 0000000..82aff35 --- /dev/null +++ b/examples/todo/src/client-test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"client-test.d.ts","sourceRoot":"","sources":["client-test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/examples/todo/src/client-test.js b/examples/todo/src/client-test.js new file mode 100644 index 0000000..b4846aa --- /dev/null +++ b/examples/todo/src/client-test.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = require("@objectstack/client"); +async function main() { + console.log('šŸš€ Starting Client SDK Test...'); + // 1. Initialize Client + const client = new client_1.ObjectStackClient({ + baseUrl: 'http://127.0.0.1:3004' + }); + try { + // 2. Connect (Auto-Discovery) + console.log('šŸ”Œ Connecting to server...'); + await client.connect(); + console.log('āœ… Connected! Discovery complete.'); + // 3. Get Metadata + console.log('šŸ” Fetching Object Metadata for "todo_task"...'); + const objectMeta = await client.meta.getObject('todo_task'); + console.log(`šŸ“‹ Object Label: ${objectMeta.label}`); + // 4. Query Data + console.log('šŸ’¾ Querying Data...'); + const result = await client.data.find('todo_task', { + top: 10, + sort: 'status' + }); + console.log(`šŸŽ‰ Found ${result.count} tasks:`); + result.value.forEach((task) => { + console.log(` - [${task.is_completed ? 'x' : ' '}] ${task.subject} (Priority: ${task.priority})`); + }); + // 5. CRUD Operations + console.log('\n✨ Creating new task...'); + const newTask = await client.data.create('todo_task', { + subject: 'Test SDK Create', + is_completed: false, + priority: 3 + }); + console.log('āœ… Created:', newTask); + // Update + if (newTask && newTask.id) { + console.log('šŸ”„ Updating task...'); + const updated = await client.data.update('todo_task', newTask.id, { + subject: 'Test SDK Create (Updated)', + is_completed: true + }); + console.log('āœ… Updated:', updated); + // Delete + console.log('šŸ—‘ļø Deleting task...'); + const deleted = await client.data.delete('todo_task', newTask.id); + console.log('āœ… Deleted:', deleted); + } + // 6. Advanced Query (Modern Filter Syntax) + console.log('\n🧠 Testing Advanced Query (Select & Modern Filter)...'); + const advancedResult = await client.data.find('todo_task', { + select: ['subject', 'priority'], + filters: { + priority: { $gte: 2 } // Modern MongoDB-style filter syntax + }, + sort: ['-priority'] + }); + console.log(`šŸŽ‰ Found ${advancedResult.count} high priority tasks:`); + advancedResult.value.forEach((task) => { + console.log(` - ${task.subject} (P${task.priority}) [Has keys: ${Object.keys(task).join(', ')}]`); + }); + } + catch (error) { + console.error('āŒ Error during test:', error); + } +} +main(); diff --git a/examples/todo/src/domains/todo/task.object.d.ts b/examples/todo/src/domains/todo/task.object.d.ts new file mode 100644 index 0000000..d9bad00 --- /dev/null +++ b/examples/todo/src/domains/todo/task.object.d.ts @@ -0,0 +1,370 @@ +export declare const TodoTask: { + name: string; + label: string; + icon: string; + nameField: string; + enable: { + apiEnabled: true; + trackHistory: true; + }; + fields: { + subject: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "text"; + }; + due_date: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "date"; + }; + is_completed: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "boolean"; + }; + priority: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + maxRating: number; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "rating"; + }; + category_color: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "color"; + }; + code_snippet: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + language: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "code"; + }; + notes: { + readonly formula?: string | undefined; + readonly options?: { + value: string; + label: string; + color?: string | undefined; + default?: boolean | undefined; + }[] | undefined; + readonly label?: string | undefined; + readonly name?: string | undefined; + readonly description?: string | undefined; + readonly format?: string | undefined; + readonly required?: boolean | undefined; + readonly searchable?: boolean | undefined; + readonly multiple?: boolean | undefined; + readonly unique?: boolean | undefined; + readonly defaultValue?: any; + readonly maxLength?: number | undefined; + readonly minLength?: number | undefined; + readonly precision?: number | undefined; + readonly scale?: number | undefined; + readonly min?: number | undefined; + readonly max?: number | undefined; + readonly reference?: string | undefined; + readonly referenceFilters?: string[] | undefined; + readonly writeRequiresMasterRead?: boolean | undefined; + readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined; + readonly expression?: string | undefined; + readonly summaryOperations?: { + object: string; + function: "min" | "max" | "count" | "sum" | "avg"; + field: string; + } | undefined; + readonly language?: string | undefined; + readonly theme?: string | undefined; + readonly lineNumbers?: boolean | undefined; + readonly maxRating?: number | undefined; + readonly allowHalf?: boolean | undefined; + readonly displayMap?: boolean | undefined; + readonly allowGeocoding?: boolean | undefined; + readonly addressFormat?: "us" | "uk" | "international" | undefined; + readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined; + readonly allowAlpha?: boolean | undefined; + readonly presetColors?: string[] | undefined; + readonly hidden?: boolean | undefined; + readonly readonly?: boolean | undefined; + readonly encryption?: boolean | undefined; + readonly index?: boolean | undefined; + readonly externalId?: boolean | undefined; + readonly type: "richtext"; + }; + }; +}; +//# sourceMappingURL=task.object.d.ts.map \ No newline at end of file diff --git a/examples/todo/src/domains/todo/task.object.d.ts.map b/examples/todo/src/domains/todo/task.object.d.ts.map new file mode 100644 index 0000000..e623441 --- /dev/null +++ b/examples/todo/src/domains/todo/task.object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"task.object.d.ts","sourceRoot":"","sources":["task.object.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;qBA2CohS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAuoS,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAt1E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAiuzD,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA12E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA10E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAA12E,CAAC;uBAAyC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADx0lE,CAAC"} \ No newline at end of file diff --git a/examples/todo/src/domains/todo/task.object.js b/examples/todo/src/domains/todo/task.object.js new file mode 100644 index 0000000..74963c8 --- /dev/null +++ b/examples/todo/src/domains/todo/task.object.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TodoTask = void 0; +const spec_1 = require("@objectstack/spec"); +exports.TodoTask = spec_1.ObjectSchema.create({ + name: 'todo_task', + label: 'Todo Task', + icon: 'check-square', + nameField: 'subject', + enable: { + apiEnabled: true, + trackHistory: true, + }, + fields: { + subject: spec_1.Field.text({ required: true }), + due_date: spec_1.Field.date(), + is_completed: spec_1.Field.boolean({ defaultValue: false }), + priority: spec_1.Field.rating(3, { + label: 'Priority', + description: 'Task priority (1-3 stars)', + }), + category_color: spec_1.Field.color({ + label: 'Category Color', + colorFormat: 'hex', + presetColors: ['#FF0000', '#00FF00', '#0000FF', '#FFFF00'], + }), + code_snippet: spec_1.Field.code('javascript', { + label: 'Code Snippet', + description: 'Optional code to implement', + lineNumbers: true, + }), + notes: spec_1.Field.richtext({ + label: 'Notes', + description: 'Rich text notes with formatting', + }), + }, + // actions: { + // // Custom button on the Record page + // complete: { + // label: 'Mark Complete', + // type: 'script', + // on: 'record', + // todo: 'update_record', + // visible: [['is_completed', '=', false]] + // } + // } +}); diff --git a/packages/spec/src/ai/model-registry.zod.ts b/packages/spec/src/ai/model-registry.zod.ts index 1ddce99..1d91ef3 100644 --- a/packages/spec/src/ai/model-registry.zod.ts +++ b/packages/spec/src/ai/model-registry.zod.ts @@ -25,13 +25,13 @@ export const ModelProviderSchema = z.enum([ * Model Capability */ export const ModelCapabilitySchema = z.object({ - textGeneration: z.boolean().default(true).describe('Supports text generation'), - textEmbedding: z.boolean().default(false).describe('Supports text embedding'), - imageGeneration: z.boolean().default(false).describe('Supports image generation'), - imageUnderstanding: z.boolean().default(false).describe('Supports image understanding'), - functionCalling: z.boolean().default(false).describe('Supports function calling'), - codeGeneration: z.boolean().default(false).describe('Supports code generation'), - reasoning: z.boolean().default(false).describe('Supports advanced reasoning'), + textGeneration: z.boolean().optional().default(true).describe('Supports text generation'), + textEmbedding: z.boolean().optional().default(false).describe('Supports text embedding'), + imageGeneration: z.boolean().optional().default(false).describe('Supports image generation'), + imageUnderstanding: z.boolean().optional().default(false).describe('Supports image understanding'), + functionCalling: z.boolean().optional().default(false).describe('Supports function calling'), + codeGeneration: z.boolean().optional().default(false).describe('Supports code generation'), + reasoning: z.boolean().optional().default(false).describe('Supports advanced reasoning'), }); /** @@ -51,7 +51,7 @@ export const ModelLimitsSchema = z.object({ * Model Pricing */ export const ModelPricingSchema = z.object({ - currency: z.string().default('USD'), + currency: z.string().optional().default('USD'), inputCostPer1kTokens: z.number().optional().describe('Cost per 1K input tokens'), outputCostPer1kTokens: z.number().optional().describe('Cost per 1K output tokens'), embeddingCostPer1kTokens: z.number().optional().describe('Cost per 1K embedding tokens'), @@ -82,7 +82,7 @@ export const ModelConfigSchema = z.object({ /** Metadata */ description: z.string().optional(), tags: z.array(z.string()).optional().describe('Tags for categorization'), - deprecated: z.boolean().default(false), + deprecated: z.boolean().optional().default(false), recommendedFor: z.array(z.string()).optional().describe('Use case recommendations'), }); @@ -130,7 +130,7 @@ export const PromptTemplateSchema = z.object({ stopSequences: z.array(z.string()).optional(), /** Metadata */ - version: z.string().default('1.0.0'), + version: z.string().optional().default('1.0.0'), description: z.string().optional(), category: z.string().optional().describe('Template category (e.g., "code_generation", "support")'), tags: z.array(z.string()).optional(), diff --git a/packages/spec/src/ai/rag-pipeline.zod.ts b/packages/spec/src/ai/rag-pipeline.zod.ts index e8cfea0..5789fe7 100644 --- a/packages/spec/src/ai/rag-pipeline.zod.ts +++ b/packages/spec/src/ai/rag-pipeline.zod.ts @@ -31,7 +31,7 @@ export const EmbeddingModelSchema = z.object({ model: z.string().describe('Model name (e.g., "text-embedding-3-large")'), dimensions: z.number().int().positive().describe('Embedding vector dimensions'), maxTokens: z.number().int().positive().optional().describe('Maximum tokens per embedding'), - batchSize: z.number().int().positive().default(100).describe('Batch size for embedding'), + batchSize: z.number().int().positive().optional().default(100).describe('Batch size for embedding'), endpoint: z.string().url().optional().describe('Custom endpoint URL'), apiKey: z.string().optional().describe('API key or reference to secret'), }); @@ -147,12 +147,12 @@ export const VectorStoreConfigSchema = z.object({ /** Configuration */ dimensions: z.number().int().positive().describe('Vector dimensions'), - metric: z.enum(['cosine', 'euclidean', 'dotproduct']).default('cosine'), + metric: z.enum(['cosine', 'euclidean', 'dotproduct']).optional().default('cosine'), /** Performance */ - batchSize: z.number().int().positive().default(100), - connectionPoolSize: z.number().int().positive().default(10), - timeout: z.number().int().positive().default(30000).describe('Timeout in milliseconds'), + batchSize: z.number().int().positive().optional().default(100), + connectionPoolSize: z.number().int().positive().optional().default(10), + timeout: z.number().int().positive().optional().default(30000).describe('Timeout in milliseconds'), }); /** @@ -168,13 +168,13 @@ export const DocumentLoaderConfigSchema = z.object({ fileTypes: z.array(z.string()).optional().describe('Accepted file extensions (e.g., [".pdf", ".md"])'), /** Processing */ - recursive: z.boolean().default(false).describe('Process directories recursively'), + recursive: z.boolean().optional().default(false).describe('Process directories recursively'), maxFileSize: z.number().int().optional().describe('Maximum file size in bytes'), excludePatterns: z.array(z.string()).optional().describe('Patterns to exclude'), /** Text Extraction */ - extractImages: z.boolean().default(false).describe('Extract text from images (OCR)'), - extractTables: z.boolean().default(false).describe('Extract and format tables'), + extractImages: z.boolean().optional().default(false).describe('Extract text from images (OCR)'), + extractTables: z.boolean().optional().default(false).describe('Extract and format tables'), /** Custom Loader */ loaderConfig: z.record(z.any()).optional().describe('Custom loader-specific config'), From ab92f959a93406f924cb3499a7779392be4ff191 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 15:38:42 +0000 Subject: [PATCH 8/8] chore: Update .gitignore to exclude example build artifacts Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com> --- .gitignore | 8 ++++++++ examples/host/debug-registry.js | 32 -------------------------------- 2 files changed, 8 insertions(+), 32 deletions(-) delete mode 100644 examples/host/debug-registry.js diff --git a/.gitignore b/.gitignore index 0212118..a6895ec 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,14 @@ temp/ packages/*/dist/ packages/*/*.tsbuildinfo +# Example builds +examples/*/dist/ +examples/*/*.d.ts +examples/*/*.d.ts.map +examples/*/*.js +!examples/*/*.config.js +!examples/*/*.config.ts + # Next.js .next out/ diff --git a/examples/host/debug-registry.js b/examples/host/debug-registry.js deleted file mode 100644 index 206e087..0000000 --- a/examples/host/debug-registry.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const runtime_1 = require("@objectstack/runtime"); -const objectql_1 = require("@objectstack/objectql"); -const driver_memory_1 = require("@objectstack/driver-memory"); -const objectstack_config_1 = __importDefault(require("@objectstack/example-todo/objectstack.config")); -(async () => { - console.log('--- Debug Registry ---'); - console.log('Apps:', [objectstack_config_1.default.name]); - console.log('Objects inside App:', objectstack_config_1.default.objects?.map((o) => o.name)); - const kernel = new runtime_1.ObjectStackKernel([ - objectstack_config_1.default, - new driver_memory_1.InMemoryDriver() - ]); - await kernel.start(); - console.log('--- Post Start ---'); - // Check Registry directly - const obj = objectql_1.SchemaRegistry.getObject('todo_task'); - console.log('Registry "todo_task":', obj ? 'FOUND' : 'MISSING'); - // Check Registry via Engine - try { - // Access private engine map if possible or simulate query - // The engine doesn't expose a 'hasObject' method easily, but we can inspect internal logic - // Actually SchemaRegistry is static, so if it's there, it's there. - } - catch (e) { - console.error(e); - } -})();