@memberjunction/metadata-sync 2.51.0 → 2.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -1
- package/dist/commands/file-reset/index.d.ts +15 -0
- package/dist/commands/file-reset/index.js +221 -0
- package/dist/commands/file-reset/index.js.map +1 -0
- package/dist/commands/push/index.d.ts +21 -0
- package/dist/commands/push/index.js +502 -42
- package/dist/commands/push/index.js.map +1 -1
- package/dist/commands/watch/index.js +39 -1
- package/dist/commands/watch/index.js.map +1 -1
- package/dist/config.d.ts +30 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/file-backup-manager.d.ts +90 -0
- package/dist/lib/file-backup-manager.js +186 -0
- package/dist/lib/file-backup-manager.js.map +1 -0
- package/dist/lib/provider-utils.d.ts +4 -2
- package/dist/lib/provider-utils.js +26 -4
- package/dist/lib/provider-utils.js.map +1 -1
- package/dist/lib/sync-engine.d.ts +4 -1
- package/dist/lib/sync-engine.js +50 -16
- package/dist/lib/sync-engine.js.map +1 -1
- package/dist/services/FormattingService.d.ts +1 -0
- package/dist/services/FormattingService.js +4 -1
- package/dist/services/FormattingService.js.map +1 -1
- package/dist/services/ValidationService.d.ts +9 -0
- package/dist/services/ValidationService.js +268 -70
- package/dist/services/ValidationService.js.map +1 -1
- package/dist/types/validation.d.ts +6 -2
- package/dist/types/validation.js.map +1 -1
- package/oclif.manifest.json +114 -45
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationService.js","sourceRoot":"","sources":["../../src/services/ValidationService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgD;AAChD,uCAAyB;AACzB,2CAA6B;AAkB7B,MAAa,iBAAiB;IAClB,QAAQ,CAAW;IACnB,MAAM,GAAsB,EAAE,CAAC;IAC/B,QAAQ,GAA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CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACK,SAAS;QACb,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YACjC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE;gBACL,UAAU,EAAE,CAAC;gBACb,aAAa,EAAE,CAAC;gBAChB,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;gBAC/B,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM;gBACnC,WAAW,EAAE,IAAI,GAAG,EAAE;aACzB;SACJ,CAAC;IACN,CAAC;CACJ;AA51BD,8CA41BC","sourcesContent":["import { Metadata } from '@memberjunction/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { \n ValidationResult, \n ValidationError, \n ValidationWarning, \n ValidationOptions, \n FileValidationResult,\n EntityDependency,\n ParsedReference,\n ReferenceType\n} from '../types/validation';\nimport { RecordData } from '../lib/sync-engine';\n\n// Type aliases for clarity\ntype EntityData = RecordData;\ntype EntitySyncConfig = any;\ntype EntityFieldData = any;\n\nexport class ValidationService {\n private metadata: Metadata;\n private errors: ValidationError[] = [];\n private warnings: ValidationWarning[] = [];\n private entityDependencies: Map<string, EntityDependency> = new Map();\n private processedEntities: Set<string> = new Set();\n private options: ValidationOptions;\n\n constructor(options: Partial<ValidationOptions> = {}) {\n this.metadata = new Metadata();\n this.options = {\n verbose: false,\n outputFormat: 'human',\n maxNestingDepth: 10,\n checkBestPractices: true,\n ...options\n };\n }\n\n /**\n * Validates all metadata files in the specified directory\n */\n public async validateDirectory(dir: string): Promise<ValidationResult> {\n this.reset();\n \n const configPath = path.join(dir, '.mj-sync.json');\n if (!fs.existsSync(configPath)) {\n this.addError({\n type: 'entity',\n severity: 'error',\n file: dir,\n message: 'No .mj-sync.json configuration file found in directory'\n });\n return this.getResult();\n }\n\n const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n const directories = await this.getDirectoriesInOrder(dir, config);\n \n let totalFiles = 0;\n let totalEntities = 0;\n const fileResults = new Map<string, FileValidationResult>();\n\n for (const subDir of directories) {\n const subDirPath = path.join(dir, subDir);\n const result = await this.validateEntityDirectory(subDirPath);\n if (result) {\n totalFiles += result.files;\n totalEntities += result.entities;\n for (const [file, fileResult] of result.fileResults) {\n fileResults.set(file, fileResult);\n }\n }\n }\n\n // Validate dependency order\n await this.validateDependencyOrder(directories);\n\n return {\n isValid: this.errors.length === 0,\n errors: this.errors,\n warnings: this.warnings,\n summary: {\n totalFiles,\n totalEntities,\n totalErrors: this.errors.length,\n totalWarnings: this.warnings.length,\n fileResults\n }\n };\n }\n\n /**\n * Validates a single entity directory\n */\n private async validateEntityDirectory(dir: string): Promise<{ files: number, entities: number, fileResults: Map<string, FileValidationResult> } | null> {\n const configPath = path.join(dir, '.mj-sync.json');\n if (!fs.existsSync(configPath)) {\n return null;\n }\n\n const config: EntitySyncConfig = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n const entityInfo = this.metadata.EntityByName(config.entity);\n \n if (!entityInfo) {\n this.addError({\n type: 'entity',\n severity: 'error',\n file: configPath,\n message: `Entity \"${config.entity}\" not found in metadata`\n });\n return null;\n }\n\n const files = await this.getMatchingFiles(dir, config.filePattern);\n let totalEntities = 0;\n const fileResults = new Map<string, FileValidationResult>();\n\n for (const file of files) {\n const filePath = path.join(dir, file);\n const result = await this.validateFile(filePath, entityInfo, config);\n totalEntities += result.entityCount;\n fileResults.set(filePath, result);\n }\n\n return { files: files.length, entities: totalEntities, fileResults };\n }\n\n /**\n * Validates a single metadata file\n */\n private async validateFile(filePath: string, entityInfo: any, config: EntitySyncConfig): Promise<FileValidationResult> {\n const fileErrors: ValidationError[] = [];\n const fileWarnings: ValidationWarning[] = [];\n let entityCount = 0;\n\n try {\n const content = fs.readFileSync(filePath, 'utf8');\n const data = JSON.parse(content);\n const entities = Array.isArray(data) ? data : [data];\n entityCount = entities.length;\n\n for (const entityData of entities) {\n await this.validateEntityData(entityData, entityInfo, filePath, config);\n }\n } catch (error) {\n fileErrors.push({\n type: 'entity',\n severity: 'error',\n file: filePath,\n message: `Failed to parse JSON: ${error instanceof Error ? error.message : String(error)}`\n });\n }\n\n // Collect errors and warnings for this file\n const currentFileErrors = this.errors.filter(e => e.file === filePath);\n const currentFileWarnings = this.warnings.filter(w => w.file === filePath);\n\n return {\n file: filePath,\n entityCount,\n errors: currentFileErrors,\n warnings: currentFileWarnings\n };\n }\n\n /**\n * Validates a single entity data object\n */\n private async validateEntityData(\n entityData: EntityData, \n entityInfo: any, \n filePath: string, \n config: EntitySyncConfig,\n parentContext?: { entity: string, field: string },\n depth: number = 0\n ): Promise<void> {\n // Check nesting depth\n if (depth > this.options.maxNestingDepth) {\n this.addWarning({\n type: 'nesting',\n severity: 'warning',\n entity: entityInfo.Name,\n file: filePath,\n message: `Nesting depth ${depth} exceeds recommended maximum of ${this.options.maxNestingDepth}`,\n suggestion: 'Consider flattening the data structure or increasing maxNestingDepth'\n });\n }\n\n // Validate fields\n if (entityData.fields) {\n await this.validateFields(entityData.fields, entityInfo, filePath, parentContext);\n }\n\n // Track dependencies\n this.trackEntityDependencies(entityData, entityInfo.Name, filePath);\n\n // Validate related entities\n if (entityData.relatedEntities) {\n for (const [relatedEntityName, relatedData] of Object.entries(entityData.relatedEntities)) {\n const relatedEntityInfo = this.metadata.EntityByName(relatedEntityName);\n if (!relatedEntityInfo) {\n this.addError({\n type: 'entity',\n severity: 'error',\n entity: entityInfo.Name,\n file: filePath,\n message: `Related entity \"${relatedEntityName}\" not found in metadata`\n });\n continue;\n }\n\n const relatedEntities = Array.isArray(relatedData) ? relatedData : [relatedData];\n for (const relatedEntity of relatedEntities) {\n await this.validateEntityData(\n relatedEntity, \n relatedEntityInfo, \n filePath, \n config,\n { entity: entityInfo.Name, field: relatedEntityName },\n depth + 1\n );\n }\n }\n }\n }\n\n /**\n * Validates entity fields\n */\n private async validateFields(\n fields: Record<string, any>, \n entityInfo: any, \n filePath: string,\n parentContext?: { entity: string, field: string }\n ): Promise<void> {\n const entityFields = entityInfo.Fields;\n const fieldMap = new Map(entityFields.map((f: any) => [f.Name, f]));\n\n for (const [fieldName, fieldValue] of Object.entries(fields)) {\n const fieldInfo = fieldMap.get(fieldName);\n \n if (!fieldInfo) {\n // Check if this might be a virtual property (getter/setter)\n try {\n const entityInstance = await this.metadata.GetEntityObject(entityInfo.Name);\n const hasProperty = fieldName in entityInstance;\n \n if (!hasProperty) {\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" does not exist on entity \"${entityInfo.Name}\"`\n });\n continue;\n }\n \n // It's a virtual property, validate the value\n await this.validateFieldValue(fieldValue, { Name: fieldName }, entityInfo, filePath, parentContext);\n continue;\n } catch (error) {\n // If we can't create an entity instance, fall back to error\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" does not exist on entity \"${entityInfo.Name}\"`\n });\n continue;\n }\n }\n\n // Check if field is settable (not system field)\n if ((fieldInfo as any).IsSystemField || fieldName.startsWith('__mj_')) {\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" is a system field and cannot be set`,\n suggestion: 'Remove this field from your metadata file'\n });\n continue;\n }\n\n // Validate field value and references\n await this.validateFieldValue(fieldValue, fieldInfo, entityInfo, filePath, parentContext);\n }\n\n // Check for required fields\n if (this.options.checkBestPractices) {\n for (const field of entityFields) {\n // Skip if field allows null or has a value already\n if (field.AllowsNull || fields[field.Name]) {\n continue;\n }\n \n // Skip if field has a default value\n if (field.DefaultValue !== null && field.DefaultValue !== undefined) {\n continue;\n }\n \n // Skip virtual/computed fields (foreign key reference fields)\n // These are typically named without 'ID' suffix but have a corresponding FK field\n const relatedEntityField = field.RelatedEntity;\n const correspondingFKField = entityFields.find((f: any) => \n f.Name === field.Name + 'ID' && f.IsForeignKey\n );\n if (relatedEntityField && correspondingFKField) {\n continue;\n }\n \n // Skip fields that are marked as AutoUpdateOnly or ReadOnly\n if ((field as any).AutoUpdateOnly || (field as any).ReadOnly) {\n continue;\n }\n \n // Skip if this is a parent context and the field can be inherited\n if (parentContext && (field.Name === parentContext.field || field.Name === parentContext.field + 'ID')) {\n continue;\n }\n \n // Special case: Skip TemplateID if TemplateText is provided (virtual property)\n if (field.Name === 'TemplateID' && fields['TemplateText']) {\n continue;\n }\n \n // Skip Template field if TemplateText is provided\n if (field.Name === 'Template' && fields['TemplateText']) {\n continue;\n }\n \n this.addWarning({\n type: 'bestpractice',\n severity: 'warning',\n entity: entityInfo.Name,\n field: field.Name,\n file: filePath,\n message: `Required field \"${field.Name}\" is missing`,\n suggestion: `Add \"${field.Name}\" to the fields object`\n });\n }\n }\n }\n\n /**\n * Validates field values and references\n */\n private async validateFieldValue(\n value: any, \n fieldInfo: any, \n entityInfo: any, \n filePath: string,\n parentContext?: { entity: string, field: string }\n ): Promise<void> {\n if (typeof value === 'string' && value.startsWith('@')) {\n await this.validateReference(value, fieldInfo, entityInfo, filePath, parentContext);\n }\n // Add type validation here if needed\n }\n\n /**\n * Validates special references (@file:, @lookup:, etc.)\n */\n private async validateReference(\n reference: string, \n fieldInfo: any, \n entityInfo: any, \n filePath: string,\n parentContext?: { entity: string, field: string }\n ): Promise<void> {\n const parsed = this.parseReference(reference);\n if (!parsed) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldInfo.Name,\n file: filePath,\n message: `Invalid reference format: \"${reference}\"`\n });\n return;\n }\n\n switch (parsed.type) {\n case '@file:':\n await this.validateFileReference(parsed.value, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@lookup:':\n await this.validateLookupReference(parsed, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@template:':\n await this.validateTemplateReference(parsed.value, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@parent:':\n this.validateParentReference(parsed.value, parentContext, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@root:':\n this.validateRootReference(parsed.value, parentContext, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n }\n }\n\n /**\n * Parses a reference string\n */\n private parseReference(reference: string): ParsedReference | null {\n const patterns: [ReferenceType, RegExp][] = [\n ['@file:', /^@file:(.+)$/],\n ['@lookup:', /^@lookup:([^.]+)\\.([^=]+)=(.+)$/],\n ['@template:', /^@template:(.+)$/],\n ['@parent:', /^@parent:(.+)$/],\n ['@root:', /^@root:(.+)$/],\n ['@env:', /^@env:(.+)$/]\n ];\n\n for (const [type, pattern] of patterns) {\n const match = reference.match(pattern);\n if (match) {\n if (type === '@lookup:') {\n const [, entity, field, valueAndOptions] = match;\n const [value, ...options] = valueAndOptions.split('?');\n const createIfMissing = options.includes('create');\n const additionalFields: Record<string, any> = {};\n \n for (const option of options) {\n if (option.includes('&')) {\n const pairs = option.split('&');\n for (const pair of pairs) {\n const [key, val] = pair.split('=');\n if (key && val && key !== 'create') {\n additionalFields[key] = val;\n }\n }\n }\n }\n\n return { type, value, entity, field, createIfMissing, additionalFields };\n }\n return { type, value: match[1] };\n }\n }\n\n return null;\n }\n\n /**\n * Validates @file: references\n */\n private async validateFileReference(\n filePath: string, \n sourceFile: string, \n entityName: string, \n fieldName: string\n ): Promise<void> {\n const dir = path.dirname(sourceFile);\n const resolvedPath = path.resolve(dir, filePath);\n \n if (!fs.existsSync(resolvedPath)) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `File reference not found: \"${filePath}\"`,\n suggestion: `Create file at: ${resolvedPath}`\n });\n }\n }\n\n /**\n * Validates @lookup: references\n */\n private async validateLookupReference(\n parsed: ParsedReference, \n sourceFile: string, \n entityName: string, \n fieldName: string\n ): Promise<void> {\n const lookupEntity = this.metadata.EntityByName(parsed.entity!);\n \n if (!lookupEntity) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Lookup entity \"${parsed.entity}\" not found`,\n suggestion: 'Check entity name spelling and case'\n });\n return;\n }\n\n const lookupField = lookupEntity.Fields.find((f: any) => f.Name === parsed.field);\n if (!lookupField) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Lookup field \"${parsed.field}\" not found on entity \"${parsed.entity}\"`,\n suggestion: `Available fields: ${lookupEntity.Fields.map((f: any) => f.Name).join(', ')}`\n });\n }\n\n // Track dependency\n this.addEntityDependency(entityName, parsed.entity!);\n }\n\n /**\n * Validates @template: references\n */\n private async validateTemplateReference(\n templatePath: string, \n sourceFile: string, \n entityName: string, \n fieldName: string\n ): Promise<void> {\n const dir = path.dirname(sourceFile);\n const resolvedPath = path.resolve(dir, templatePath);\n \n if (!fs.existsSync(resolvedPath)) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Template file not found: \"${templatePath}\"`,\n suggestion: `Create template at: ${resolvedPath}`\n });\n return;\n }\n\n // Validate template is valid JSON\n try {\n JSON.parse(fs.readFileSync(resolvedPath, 'utf8'));\n } catch (error) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Template file is not valid JSON: \"${templatePath}\"`,\n details: error instanceof Error ? error.message : String(error)\n });\n }\n }\n\n /**\n * Validates @parent: references\n */\n private validateParentReference(\n fieldName: string, \n parentContext: { entity: string, field: string } | undefined,\n sourceFile: string,\n entityName: string,\n currentFieldName: string\n ): void {\n if (!parentContext) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: currentFieldName,\n file: sourceFile,\n message: `@parent: reference used but no parent context exists`,\n suggestion: '@parent: can only be used in nested/related entities'\n });\n }\n }\n\n /**\n * Validates @root: references\n */\n private validateRootReference(\n fieldName: string, \n parentContext: { entity: string, field: string } | undefined,\n sourceFile: string,\n entityName: string,\n currentFieldName: string\n ): void {\n if (!parentContext) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: currentFieldName,\n file: sourceFile,\n message: `@root: reference used but no root context exists`,\n suggestion: '@root: can only be used in nested/related entities'\n });\n }\n }\n\n /**\n * Track entity dependencies\n */\n private trackEntityDependencies(entityData: EntityData, entityName: string, filePath: string): void {\n if (!this.entityDependencies.has(entityName)) {\n this.entityDependencies.set(entityName, {\n entityName,\n dependsOn: new Set(),\n file: filePath\n });\n }\n\n // Track dependencies from lookups in fields\n if (entityData.fields) {\n for (const value of Object.values(entityData.fields)) {\n if (typeof value === 'string' && value.startsWith('@lookup:')) {\n const parsed = this.parseReference(value);\n if (parsed?.entity) {\n this.addEntityDependency(entityName, parsed.entity);\n }\n }\n }\n }\n }\n\n /**\n * Add an entity dependency\n */\n private addEntityDependency(from: string, to: string): void {\n if (!this.entityDependencies.has(from)) {\n this.entityDependencies.set(from, {\n entityName: from,\n dependsOn: new Set(),\n file: ''\n });\n }\n this.entityDependencies.get(from)!.dependsOn.add(to);\n }\n\n /**\n * Validates dependency order\n */\n private async validateDependencyOrder(directoryOrder: string[]): Promise<void> {\n // Build a map of entity to directory\n const entityToDirectory = new Map<string, string>();\n \n for (const dir of directoryOrder) {\n // This is simplified - in reality we'd need to read the .mj-sync.json\n // to get the actual entity name\n entityToDirectory.set(dir, dir);\n }\n\n // Check for circular dependencies\n const visited = new Set<string>();\n const recursionStack = new Set<string>();\n \n for (const [entity, deps] of this.entityDependencies) {\n if (!visited.has(entity)) {\n this.checkCircularDependency(entity, visited, recursionStack);\n }\n }\n\n // Check if current order satisfies dependencies\n const orderViolations = this.checkDependencyOrder(directoryOrder);\n if (orderViolations.length > 0) {\n // Suggest a corrected order\n const suggestedOrder = this.topologicalSort();\n \n for (const violation of orderViolations) {\n this.addError({\n type: 'dependency',\n severity: 'error',\n entity: violation.entity,\n file: violation.file,\n message: `Entity '${violation.entity}' depends on '${violation.dependency}' but is processed before it`,\n suggestion: `Reorder directories to: [${suggestedOrder.join(', ')}]`\n });\n }\n }\n }\n\n /**\n * Check for circular dependencies\n */\n private checkCircularDependency(\n entity: string, \n visited: Set<string>, \n recursionStack: Set<string>,\n path: string[] = []\n ): boolean {\n visited.add(entity);\n recursionStack.add(entity);\n path.push(entity);\n\n const deps = this.entityDependencies.get(entity);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!visited.has(dep)) {\n if (this.checkCircularDependency(dep, visited, recursionStack, [...path])) {\n return true;\n }\n } else if (recursionStack.has(dep)) {\n // Found circular dependency\n const cycle = [...path, dep];\n const cycleStart = cycle.indexOf(dep);\n const cyclePath = cycle.slice(cycleStart).join(' → ');\n \n this.addError({\n type: 'circular',\n severity: 'error',\n entity: entity,\n file: deps.file,\n message: `Circular dependency detected: ${cyclePath}`,\n suggestion: 'Restructure your entities to avoid circular references'\n });\n return true;\n }\n }\n }\n\n recursionStack.delete(entity);\n return false;\n }\n\n /**\n * Get directories in order based on config\n */\n private async getDirectoriesInOrder(rootDir: string, config: any): Promise<string[]> {\n const allDirs = fs.readdirSync(rootDir)\n .filter(f => fs.statSync(path.join(rootDir, f)).isDirectory())\n .filter(d => !d.startsWith('.'));\n\n if (config.directoryOrder && Array.isArray(config.directoryOrder)) {\n const ordered = config.directoryOrder.filter((d: string) => allDirs.includes(d));\n const remaining = allDirs.filter(d => !ordered.includes(d)).sort();\n return [...ordered, ...remaining];\n }\n\n return allDirs.sort();\n }\n\n /**\n * Get files matching pattern\n */\n private async getMatchingFiles(dir: string, pattern: string): Promise<string[]> {\n const files = fs.readdirSync(dir)\n .filter(f => fs.statSync(path.join(dir, f)).isFile());\n \n // Simple glob pattern matching\n if (pattern === '*.json') {\n return files.filter(f => f.endsWith('.json') && !f.startsWith('.mj-'));\n } else if (pattern === '.*.json') {\n return files.filter(f => f.startsWith('.') && f.endsWith('.json') && !f.startsWith('.mj-'));\n }\n \n return files;\n }\n\n /**\n * Add an error\n */\n private addError(error: ValidationError): void {\n this.errors.push(error);\n }\n\n /**\n * Add a warning\n */\n private addWarning(warning: ValidationWarning): void {\n this.warnings.push(warning);\n }\n\n /**\n * Check if current directory order satisfies dependencies\n */\n private checkDependencyOrder(directoryOrder: string[]): Array<{entity: string, dependency: string, file: string}> {\n const violations: Array<{entity: string, dependency: string, file: string}> = [];\n const processedEntities = new Set<string>();\n \n for (const dir of directoryOrder) {\n // In real implementation, we'd read .mj-sync.json to get entity name\n const entityName = dir; // Simplified for now\n \n const deps = this.entityDependencies.get(entityName);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!processedEntities.has(dep) && directoryOrder.includes(dep)) {\n violations.push({\n entity: entityName,\n dependency: dep,\n file: deps.file\n });\n }\n }\n }\n \n processedEntities.add(entityName);\n }\n \n return violations;\n }\n\n /**\n * Perform topological sort on entity dependencies\n */\n private topologicalSort(): string[] {\n const result: string[] = [];\n const visited = new Set<string>();\n const tempStack = new Set<string>();\n \n const visit = (entity: string): boolean => {\n if (tempStack.has(entity)) {\n // Circular dependency, already handled by checkCircularDependency\n return false;\n }\n \n if (visited.has(entity)) {\n return true;\n }\n \n tempStack.add(entity);\n \n const deps = this.entityDependencies.get(entity);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!visit(dep)) {\n return false;\n }\n }\n }\n \n tempStack.delete(entity);\n visited.add(entity);\n result.push(entity);\n \n return true;\n };\n \n // Visit all entities\n for (const entity of this.entityDependencies.keys()) {\n if (!visited.has(entity)) {\n visit(entity);\n }\n }\n \n return result;\n }\n\n /**\n * Reset validation state\n */\n private reset(): void {\n this.errors = [];\n this.warnings = [];\n this.entityDependencies.clear();\n this.processedEntities.clear();\n }\n\n /**\n * Get validation result\n */\n private getResult(): ValidationResult {\n return {\n isValid: this.errors.length === 0,\n errors: this.errors,\n warnings: this.warnings,\n summary: {\n totalFiles: 0,\n totalEntities: 0,\n totalErrors: this.errors.length,\n totalWarnings: this.warnings.length,\n fileResults: new Map()\n }\n };\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"ValidationService.js","sourceRoot":"","sources":["../../src/services/ValidationService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyD;AACzD,uCAAyB;AACzB,2CAA6B;AAY7B,0DAAsD;AAMtD,MAAa,iBAAiB;IACpB,QAAQ,CAAW;IACnB,MAAM,GAAsB,EAAE,CAAC;IAC/B,QAAQ,GAAwB,EAAE,CAAC;IACnC,kBAAkB,GAAkC,IAAI,GAAG,EAAE,CAAC;IAC9D,iBAAiB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C,OAAO,CAAoB;IAC3B,aAAa,GAA0B,IAAI,GAAG,EAAE,CAAC;IAEzD,YAAY,UAAsC,EAAE;QAClD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG;YACb,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,OAAO;YACrB,eAAe,EAAE,EAAE;YACnB,kBAAkB,EAAE,IAAI;YACxB,GAAG,OAAO;SACX,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,iBAAiB,CAAC,GAAW;QACxC,IAAI,CAAC,KAAK,EAAE,CAAC;QAEb,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,CAAC;gBACZ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,OAAO;gBACjB,IAAI,EAAE,GAAG;gBACT,OAAO,EAAE,wDAAwD;aAClE,CAAC,CAAC;YACH,OAAO,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oCAAoC;oBAC9D,UAAU,EACR,YAAY,CAAC,MAAM,GAAG,CAAC;wBACrB,CAAC,CAAC,sCAAsC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;wBACjE,CAAC,CAAC,2EAA2E;iBAClF,CAAC,CAAC;YACL,CAAC;YACD,OAAO;QACT,CAAC;QAED,8CAA8C;QAC9C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,cAAc,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7E,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,IAAI,CAAC,QAAQ,CAAC;oBACZ,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,OAAO;oBACjB,MAAM,EAAE,UAAU;oBAClB,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,WAAW,MAAM,gBAAgB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC;oBAC9F,UAAU,EAAE,kBAAkB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBACxD,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3hCD,8CA2hCC","sourcesContent":["import { Metadata, RunView } from '@memberjunction/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport {\n ValidationResult,\n ValidationError,\n ValidationWarning,\n ValidationOptions,\n FileValidationResult,\n EntityDependency,\n ParsedReference,\n ReferenceType,\n} from '../types/validation';\nimport { RecordData } from '../lib/sync-engine';\nimport { getSystemUser } from '../lib/provider-utils';\n\n// Type aliases for clarity\ntype EntityData = RecordData;\ntype EntitySyncConfig = any;\n\nexport class ValidationService {\n private metadata: Metadata;\n private errors: ValidationError[] = [];\n private warnings: ValidationWarning[] = [];\n private entityDependencies: Map<string, EntityDependency> = new Map();\n private processedEntities: Set<string> = new Set();\n private options: ValidationOptions;\n private userRoleCache: Map<string, string[]> = new Map();\n\n constructor(options: Partial<ValidationOptions> = {}) {\n this.metadata = new Metadata();\n this.options = {\n verbose: false,\n outputFormat: 'human',\n maxNestingDepth: 10,\n checkBestPractices: true,\n ...options,\n };\n }\n\n /**\n * Validates all metadata files in the specified directory\n */\n public async validateDirectory(dir: string): Promise<ValidationResult> {\n this.reset();\n\n const configPath = path.join(dir, '.mj-sync.json');\n if (!fs.existsSync(configPath)) {\n this.addError({\n type: 'entity',\n severity: 'error',\n file: dir,\n message: 'No .mj-sync.json configuration file found in directory',\n });\n return this.getResult();\n }\n\n const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n\n // Load user role configuration and cache if enabled\n if (config.userRoleValidation?.enabled) {\n await this.loadUserRoles();\n }\n\n const directories = await this.getDirectoriesInOrder(dir, config);\n\n let totalFiles = 0;\n let totalEntities = 0;\n const fileResults = new Map<string, FileValidationResult>();\n\n for (const subDir of directories) {\n const subDirPath = path.join(dir, subDir);\n const result = await this.validateEntityDirectory(subDirPath);\n if (result) {\n totalFiles += result.files;\n totalEntities += result.entities;\n for (const [file, fileResult] of result.fileResults) {\n fileResults.set(file, fileResult);\n }\n }\n }\n\n // Validate dependency order\n await this.validateDependencyOrder(directories);\n\n return {\n isValid: this.errors.length === 0,\n errors: this.errors,\n warnings: this.warnings,\n summary: {\n totalFiles,\n totalEntities,\n totalErrors: this.errors.length,\n totalWarnings: this.warnings.length,\n fileResults,\n },\n };\n }\n\n /**\n * Validates a single entity directory\n */\n private async validateEntityDirectory(dir: string): Promise<{ files: number; entities: number; fileResults: Map<string, FileValidationResult> } | null> {\n // Check for .mj-folder.json first (new format)\n let configPath = path.join(dir, '.mj-folder.json');\n let config: any;\n \n if (fs.existsSync(configPath)) {\n config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n // .mj-folder.json uses entityName field\n if (!config.entityName) {\n this.addError({\n type: 'validation',\n severity: 'error',\n file: configPath,\n message: 'Missing entityName field in .mj-folder.json',\n });\n return null;\n }\n config.entity = config.entityName; // Normalize to entity field\n } else {\n // Fall back to .mj-sync.json (legacy format)\n configPath = path.join(dir, '.mj-sync.json');\n if (!fs.existsSync(configPath)) {\n return null;\n }\n config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\n }\n\n // Validate entity name exists\n if (!config.entity || config.entity.trim() === '') {\n this.addError({\n type: 'validation',\n severity: 'error',\n file: configPath,\n message: 'Entity name is empty or missing',\n });\n return null;\n }\n\n const entityInfo = this.metadata.EntityByName(config.entity);\n\n if (!entityInfo) {\n this.addError({\n type: 'entity',\n severity: 'error',\n file: configPath,\n message: `Entity \"${config.entity}\" not found in metadata`,\n });\n return null;\n }\n\n const files = await this.getMatchingFiles(dir, config.filePattern);\n let totalEntities = 0;\n const fileResults = new Map<string, FileValidationResult>();\n\n for (const file of files) {\n const filePath = path.join(dir, file);\n const result = await this.validateFile(filePath, entityInfo, config);\n totalEntities += result.entityCount;\n fileResults.set(filePath, result);\n }\n\n return { files: files.length, entities: totalEntities, fileResults };\n }\n\n /**\n * Validates a single metadata file\n */\n private async validateFile(filePath: string, entityInfo: any, config: EntitySyncConfig): Promise<FileValidationResult> {\n const fileErrors: ValidationError[] = [];\n let entityCount = 0;\n\n try {\n const content = fs.readFileSync(filePath, 'utf8');\n const data = JSON.parse(content);\n const entities = Array.isArray(data) ? data : [data];\n entityCount = entities.length;\n\n for (const entityData of entities) {\n await this.validateEntityData(entityData, entityInfo, filePath, config);\n }\n } catch (error) {\n fileErrors.push({\n type: 'entity',\n severity: 'error',\n file: filePath,\n message: `Failed to parse JSON: ${error instanceof Error ? error.message : String(error)}`,\n });\n }\n\n // Collect errors and warnings for this file\n const currentFileErrors = this.errors.filter((e) => e.file === filePath);\n const currentFileWarnings = this.warnings.filter((w) => w.file === filePath);\n\n return {\n file: filePath,\n entityCount,\n errors: currentFileErrors,\n warnings: currentFileWarnings,\n };\n }\n\n /**\n * Validates a single entity data object\n */\n private async validateEntityData(\n entityData: EntityData,\n entityInfo: any,\n filePath: string,\n config: EntitySyncConfig,\n parentContext?: { entity: string; field: string },\n depth: number = 0,\n ): Promise<void> {\n // Check nesting depth\n if (depth > this.options.maxNestingDepth) {\n this.addWarning({\n type: 'nesting',\n severity: 'warning',\n entity: entityInfo.Name,\n file: filePath,\n message: `Nesting depth ${depth} exceeds recommended maximum of ${this.options.maxNestingDepth}`,\n suggestion: 'Consider flattening the data structure or increasing maxNestingDepth',\n });\n }\n\n // Validate fields\n if (entityData.fields) {\n await this.validateFields(entityData.fields, entityInfo, filePath, parentContext);\n }\n\n // Track dependencies\n this.trackEntityDependencies(entityData, entityInfo.Name, filePath);\n\n // Validate related entities\n if (entityData.relatedEntities) {\n for (const [relatedEntityName, relatedData] of Object.entries(entityData.relatedEntities)) {\n const relatedEntityInfo = this.metadata.EntityByName(relatedEntityName);\n if (!relatedEntityInfo) {\n this.addError({\n type: 'entity',\n severity: 'error',\n entity: entityInfo.Name,\n file: filePath,\n message: `Related entity \"${relatedEntityName}\" not found in metadata`,\n });\n continue;\n }\n\n const relatedEntities = Array.isArray(relatedData) ? relatedData : [relatedData];\n for (const relatedEntity of relatedEntities) {\n await this.validateEntityData(relatedEntity, relatedEntityInfo, filePath, config, { entity: entityInfo.Name, field: relatedEntityName }, depth + 1);\n }\n }\n }\n }\n\n /**\n * Validates entity fields\n */\n private async validateFields(\n fields: Record<string, any>,\n entityInfo: any,\n filePath: string,\n parentContext?: { entity: string; field: string },\n ): Promise<void> {\n const entityFields = entityInfo.Fields;\n const fieldMap = new Map(entityFields.map((f: any) => [f.Name, f]));\n\n for (const [fieldName, fieldValue] of Object.entries(fields)) {\n const fieldInfo = fieldMap.get(fieldName);\n\n if (!fieldInfo) {\n // Check if this might be a virtual property (getter/setter)\n try {\n const entityInstance = await this.metadata.GetEntityObject(entityInfo.Name);\n const hasProperty = fieldName in entityInstance;\n\n if (!hasProperty) {\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" does not exist on entity \"${entityInfo.Name}\"`,\n });\n continue;\n }\n\n // It's a virtual property, validate the value\n await this.validateFieldValue(fieldValue, { Name: fieldName }, entityInfo, filePath, parentContext);\n continue;\n } catch (error) {\n // If we can't create an entity instance, fall back to error\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" does not exist on entity \"${entityInfo.Name}\"`,\n });\n continue;\n }\n }\n\n // Check if field is settable (not system field)\n if ((fieldInfo as any).IsSystemField || fieldName.startsWith('__mj_')) {\n this.addError({\n type: 'field',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldName,\n file: filePath,\n message: `Field \"${fieldName}\" is a system field and cannot be set`,\n suggestion: 'Remove this field from your metadata file',\n });\n continue;\n }\n\n // Validate field value and references\n await this.validateFieldValue(fieldValue, fieldInfo, entityInfo, filePath, parentContext);\n }\n\n // Check for required fields\n if (this.options.checkBestPractices) {\n for (const field of entityFields) {\n // Skip if field allows null or has a value already\n if (field.AllowsNull || fields[field.Name]) {\n continue;\n }\n\n // Skip if field has a default value\n if (field.DefaultValue !== null && field.DefaultValue !== undefined) {\n continue;\n }\n\n // Skip virtual/computed fields (foreign key reference fields)\n // These are typically named without 'ID' suffix but have a corresponding FK field\n const relatedEntityField = field.RelatedEntity;\n const correspondingFKField = entityFields.find((f: any) => f.Name === field.Name + 'ID' && f.IsForeignKey);\n if (relatedEntityField && correspondingFKField) {\n continue;\n }\n\n // Skip fields that are marked as AutoUpdateOnly or ReadOnly\n if ((field as any).AutoUpdateOnly || (field as any).ReadOnly) {\n continue;\n }\n\n // Skip if this is a parent context and the field can be inherited\n if (parentContext && (field.Name === parentContext.field || field.Name === parentContext.field + 'ID')) {\n continue;\n }\n\n // Special case: Skip TemplateID if TemplateText is provided (virtual property)\n if (field.Name === 'TemplateID' && fields['TemplateText']) {\n continue;\n }\n\n // Skip Template field if TemplateText is provided\n if (field.Name === 'Template' && fields['TemplateText']) {\n continue;\n }\n\n this.addWarning({\n type: 'bestpractice',\n severity: 'warning',\n entity: entityInfo.Name,\n field: field.Name,\n file: filePath,\n message: `Required field \"${field.Name}\" is missing`,\n suggestion: `Add \"${field.Name}\" to the fields object`,\n });\n }\n }\n }\n\n /**\n * Validates field values and references\n */\n private async validateFieldValue(\n value: any,\n fieldInfo: any,\n entityInfo: any,\n filePath: string,\n parentContext?: { entity: string; field: string },\n ): Promise<void> {\n if (typeof value === 'string' && value.startsWith('@')) {\n await this.validateReference(value, fieldInfo, entityInfo, filePath, parentContext);\n }\n\n // Validate UserID fields against allowed roles\n if (fieldInfo.Name === 'UserID' && typeof value === 'string' && value.length > 0) {\n // Get the sync config from the file's directory\n const dir = path.dirname(filePath);\n\n // Walk up to find the root sync config with userRoleValidation\n let currentDir = dir;\n let config = null;\n while (currentDir && currentDir !== path.parse(currentDir).root) {\n const currentConfigPath = path.join(currentDir, '.mj-sync.json');\n if (fs.existsSync(currentConfigPath)) {\n try {\n const currentConfig = JSON.parse(fs.readFileSync(currentConfigPath, 'utf8'));\n if (currentConfig.userRoleValidation) {\n config = currentConfig;\n break;\n }\n } catch {\n // Ignore parse errors\n }\n }\n currentDir = path.dirname(currentDir);\n }\n\n if (config?.userRoleValidation?.enabled) {\n await this.validateUserRole(value, entityInfo.Name, fieldInfo.Name, filePath, config);\n }\n }\n\n // Add other type validation here if needed\n }\n\n /**\n * Validates special references (@file:, @lookup:, etc.)\n */\n private async validateReference(\n reference: string,\n fieldInfo: any,\n entityInfo: any,\n filePath: string,\n parentContext?: { entity: string; field: string },\n ): Promise<void> {\n const parsed = this.parseReference(reference);\n if (!parsed) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityInfo.Name,\n field: fieldInfo.Name,\n file: filePath,\n message: `Invalid reference format: \"${reference}\"`,\n });\n return;\n }\n\n switch (parsed.type) {\n case '@file:':\n await this.validateFileReference(parsed.value, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@lookup:':\n await this.validateLookupReference(parsed, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@template:':\n await this.validateTemplateReference(parsed.value, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@parent:':\n this.validateParentReference(parsed.value, parentContext, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n case '@root:':\n this.validateRootReference(parsed.value, parentContext, filePath, entityInfo.Name, fieldInfo.Name);\n break;\n }\n }\n\n /**\n * Parses a reference string\n */\n private parseReference(reference: string): ParsedReference | null {\n const patterns: [ReferenceType, RegExp][] = [\n ['@file:', /^@file:(.+)$/],\n ['@lookup:', /^@lookup:([^.]+)\\.(.+)$/],\n ['@template:', /^@template:(.+)$/],\n ['@parent:', /^@parent:(.+)$/],\n ['@root:', /^@root:(.+)$/],\n ['@env:', /^@env:(.+)$/],\n ];\n\n for (const [type, pattern] of patterns) {\n const match = reference.match(pattern);\n if (match) {\n if (type === '@lookup:') {\n const [, entity, remaining] = match;\n \n // Check if this has ?create syntax\n const hasCreate = remaining.includes('?create');\n const lookupPart = hasCreate ? remaining.split('?')[0] : remaining;\n \n // Parse all lookup fields (can be multiple with &)\n const lookupPairs = lookupPart.split('&');\n const fields: Array<{field: string, value: string}> = [];\n \n for (const pair of lookupPairs) {\n const fieldMatch = pair.match(/^(.+?)=(.+)$/);\n if (fieldMatch) {\n const [, field, value] = fieldMatch;\n fields.push({ field: field.trim(), value: value.trim() });\n }\n }\n \n // For backward compatibility, use the first field as primary\n const primaryField = fields.length > 0 ? fields[0] : { field: '', value: '' };\n \n // Parse additional fields for creation if ?create is present\n const additionalFields: Record<string, any> = {};\n if (hasCreate && remaining.includes('?create&')) {\n const createPart = remaining.split('?create&')[1];\n const pairs = createPart.split('&');\n for (const pair of pairs) {\n const [key, val] = pair.split('=');\n if (key && val) {\n additionalFields[key] = decodeURIComponent(val);\n }\n }\n }\n\n return { \n type, \n value: primaryField.value, \n entity, \n field: primaryField.field,\n fields, // Include all fields for validation\n createIfMissing: hasCreate, \n additionalFields \n };\n }\n return { type, value: match[1] };\n }\n }\n\n return null;\n }\n\n /**\n * Validates @file: references\n */\n private async validateFileReference(filePath: string, sourceFile: string, entityName: string, fieldName: string): Promise<void> {\n const dir = path.dirname(sourceFile);\n const resolvedPath = path.resolve(dir, filePath);\n\n if (!fs.existsSync(resolvedPath)) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `File reference not found: \"${filePath}\"`,\n suggestion: `Create file at: ${resolvedPath}`,\n });\n }\n }\n\n /**\n * Validates @lookup: references\n */\n private async validateLookupReference(parsed: ParsedReference, sourceFile: string, entityName: string, fieldName: string): Promise<void> {\n const lookupEntity = this.metadata.EntityByName(parsed.entity!);\n\n if (!lookupEntity) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Lookup entity \"${parsed.entity}\" not found`,\n suggestion: 'Check entity name spelling and case',\n });\n return;\n }\n\n // For multi-field lookups, validate all fields\n if (parsed.fields && parsed.fields.length > 0) {\n for (const {field} of parsed.fields) {\n const lookupField = lookupEntity.Fields.find((f: any) => f.Name === field);\n if (!lookupField) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Lookup field \"${field}\" not found on entity \"${parsed.entity}\"`,\n suggestion: `Available fields: ${lookupEntity.Fields.map((f: any) => f.Name).join(', ')}`,\n });\n }\n }\n } else if (parsed.field) {\n // Fallback for single field lookup (backward compatibility)\n const lookupField = lookupEntity.Fields.find((f: any) => f.Name === parsed.field);\n if (!lookupField) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Lookup field \"${parsed.field}\" not found on entity \"${parsed.entity}\"`,\n suggestion: `Available fields: ${lookupEntity.Fields.map((f: any) => f.Name).join(', ')}`,\n });\n }\n }\n\n // Track dependency\n this.addEntityDependency(entityName, parsed.entity!);\n }\n\n /**\n * Validates @template: references\n */\n private async validateTemplateReference(templatePath: string, sourceFile: string, entityName: string, fieldName: string): Promise<void> {\n const dir = path.dirname(sourceFile);\n const resolvedPath = path.resolve(dir, templatePath);\n\n if (!fs.existsSync(resolvedPath)) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Template file not found: \"${templatePath}\"`,\n suggestion: `Create template at: ${resolvedPath}`,\n });\n return;\n }\n\n // Validate template is valid JSON\n try {\n JSON.parse(fs.readFileSync(resolvedPath, 'utf8'));\n } catch (error) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: sourceFile,\n message: `Template file is not valid JSON: \"${templatePath}\"`,\n details: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n /**\n * Validates @parent: references\n */\n private validateParentReference(\n _fieldName: string,\n parentContext: { entity: string; field: string } | undefined,\n sourceFile: string,\n entityName: string,\n currentFieldName: string,\n ): void {\n if (!parentContext) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: currentFieldName,\n file: sourceFile,\n message: `@parent: reference used but no parent context exists`,\n suggestion: '@parent: can only be used in nested/related entities',\n });\n }\n }\n\n /**\n * Validates @root: references\n */\n private validateRootReference(\n _fieldName: string,\n parentContext: { entity: string; field: string } | undefined,\n sourceFile: string,\n entityName: string,\n currentFieldName: string,\n ): void {\n if (!parentContext) {\n this.addError({\n type: 'reference',\n severity: 'error',\n entity: entityName,\n field: currentFieldName,\n file: sourceFile,\n message: `@root: reference used but no root context exists`,\n suggestion: '@root: can only be used in nested/related entities',\n });\n }\n }\n\n /**\n * Track entity dependencies\n */\n private trackEntityDependencies(entityData: EntityData, entityName: string, filePath: string): void {\n if (!this.entityDependencies.has(entityName)) {\n this.entityDependencies.set(entityName, {\n entityName,\n dependsOn: new Set(),\n file: filePath,\n });\n }\n\n // Track dependencies from lookups in fields\n if (entityData.fields) {\n for (const value of Object.values(entityData.fields)) {\n if (typeof value === 'string' && value.startsWith('@lookup:')) {\n const parsed = this.parseReference(value);\n if (parsed?.entity) {\n this.addEntityDependency(entityName, parsed.entity);\n }\n }\n }\n }\n }\n\n /**\n * Add an entity dependency\n */\n private addEntityDependency(from: string, to: string): void {\n // Don't add self-references as dependencies (e.g., ParentID in hierarchical structures)\n if (from === to) {\n return;\n }\n \n if (!this.entityDependencies.has(from)) {\n this.entityDependencies.set(from, {\n entityName: from,\n dependsOn: new Set(),\n file: '',\n });\n }\n this.entityDependencies.get(from)!.dependsOn.add(to);\n }\n\n /**\n * Validates dependency order\n */\n private async validateDependencyOrder(directoryOrder: string[]): Promise<void> {\n // Build a map of entity to directory\n const entityToDirectory = new Map<string, string>();\n\n for (const dir of directoryOrder) {\n // This is simplified - in reality we'd need to read the .mj-sync.json\n // to get the actual entity name\n entityToDirectory.set(dir, dir);\n }\n\n // Check for circular dependencies\n const visited = new Set<string>();\n const recursionStack = new Set<string>();\n\n for (const [entity] of this.entityDependencies) {\n if (!visited.has(entity)) {\n this.checkCircularDependency(entity, visited, recursionStack);\n }\n }\n\n // Check if current order satisfies dependencies\n const orderViolations = this.checkDependencyOrder(directoryOrder);\n if (orderViolations.length > 0) {\n // Suggest a corrected order\n const suggestedOrder = this.topologicalSort();\n\n for (const violation of orderViolations) {\n this.addError({\n type: 'dependency',\n severity: 'error',\n entity: violation.entity,\n file: violation.file,\n message: `Entity '${violation.entity}' depends on '${violation.dependency}' but is processed before it`,\n suggestion: `Reorder directories to: [${suggestedOrder.join(', ')}]`,\n });\n }\n }\n }\n\n /**\n * Check for circular dependencies\n */\n private checkCircularDependency(entity: string, visited: Set<string>, recursionStack: Set<string>, path: string[] = []): boolean {\n visited.add(entity);\n recursionStack.add(entity);\n path.push(entity);\n\n const deps = this.entityDependencies.get(entity);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!visited.has(dep)) {\n if (this.checkCircularDependency(dep, visited, recursionStack, [...path])) {\n return true;\n }\n } else if (recursionStack.has(dep)) {\n // Found circular dependency\n const cycle = [...path, dep];\n const cycleStart = cycle.indexOf(dep);\n const cyclePath = cycle.slice(cycleStart).join(' → ');\n\n this.addError({\n type: 'circular',\n severity: 'error',\n entity: entity,\n file: deps.file,\n message: `Circular dependency detected: ${cyclePath}`,\n suggestion: 'Restructure your entities to avoid circular references',\n });\n return true;\n }\n }\n }\n\n recursionStack.delete(entity);\n return false;\n }\n\n /**\n * Get directories in order based on config\n */\n private async getDirectoriesInOrder(rootDir: string, config: any): Promise<string[]> {\n const allDirs = fs\n .readdirSync(rootDir)\n .filter((f) => fs.statSync(path.join(rootDir, f)).isDirectory())\n .filter((d) => !d.startsWith('.'));\n\n if (config.directoryOrder && Array.isArray(config.directoryOrder)) {\n const ordered = config.directoryOrder.filter((d: string) => allDirs.includes(d));\n const remaining = allDirs.filter((d) => !ordered.includes(d)).sort();\n return [...ordered, ...remaining];\n }\n\n return allDirs.sort();\n }\n\n /**\n * Get files matching pattern\n */\n private async getMatchingFiles(dir: string, pattern: string): Promise<string[]> {\n const files = fs.readdirSync(dir).filter((f) => fs.statSync(path.join(dir, f)).isFile());\n\n // Simple glob pattern matching\n if (pattern === '*.json') {\n return files.filter((f) => f.endsWith('.json') && !f.startsWith('.mj-'));\n } else if (pattern === '.*.json') {\n return files.filter((f) => f.startsWith('.') && f.endsWith('.json') && !f.startsWith('.mj-'));\n }\n\n return files;\n }\n\n /**\n * Add an error\n */\n private addError(error: ValidationError): void {\n this.errors.push(error);\n }\n\n /**\n * Add a warning\n */\n private addWarning(warning: ValidationWarning): void {\n this.warnings.push(warning);\n }\n\n /**\n * Check if current directory order satisfies dependencies\n */\n private checkDependencyOrder(directoryOrder: string[]): Array<{ entity: string; dependency: string; file: string }> {\n const violations: Array<{ entity: string; dependency: string; file: string }> = [];\n const processedEntities = new Set<string>();\n\n for (const dir of directoryOrder) {\n // In real implementation, we'd read .mj-sync.json to get entity name\n const entityName = dir; // Simplified for now\n\n const deps = this.entityDependencies.get(entityName);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!processedEntities.has(dep) && directoryOrder.includes(dep)) {\n violations.push({\n entity: entityName,\n dependency: dep,\n file: deps.file,\n });\n }\n }\n }\n\n processedEntities.add(entityName);\n }\n\n return violations;\n }\n\n /**\n * Perform topological sort on entity dependencies\n */\n private topologicalSort(): string[] {\n const result: string[] = [];\n const visited = new Set<string>();\n const tempStack = new Set<string>();\n\n const visit = (entity: string): boolean => {\n if (tempStack.has(entity)) {\n // Circular dependency, already handled by checkCircularDependency\n return false;\n }\n\n if (visited.has(entity)) {\n return true;\n }\n\n tempStack.add(entity);\n\n const deps = this.entityDependencies.get(entity);\n if (deps) {\n for (const dep of deps.dependsOn) {\n if (!visit(dep)) {\n return false;\n }\n }\n }\n\n tempStack.delete(entity);\n visited.add(entity);\n result.push(entity);\n\n return true;\n };\n\n // Visit all entities\n for (const entity of this.entityDependencies.keys()) {\n if (!visited.has(entity)) {\n visit(entity);\n }\n }\n\n return result;\n }\n\n /**\n * Reset validation state\n */\n private reset(): void {\n this.errors = [];\n this.warnings = [];\n this.entityDependencies.clear();\n this.processedEntities.clear();\n this.userRoleCache.clear();\n }\n\n /**\n * Get validation result\n */\n private getResult(): ValidationResult {\n return {\n isValid: this.errors.length === 0,\n errors: this.errors,\n warnings: this.warnings,\n summary: {\n totalFiles: 0,\n totalEntities: 0,\n totalErrors: this.errors.length,\n totalWarnings: this.warnings.length,\n fileResults: new Map(),\n },\n };\n }\n\n /**\n * Load user roles from the database into cache\n */\n private async loadUserRoles(): Promise<void> {\n try {\n const rv = new RunView();\n const systemUser = getSystemUser();\n\n // Load all user roles with role names\n const result = await rv.RunView(\n {\n EntityName: 'User Roles',\n ExtraFilter: '',\n OrderBy: 'UserID',\n MaxRows: 10000,\n },\n systemUser,\n );\n\n if (!result.Success) {\n this.addWarning({\n type: 'validation',\n severity: 'warning',\n file: 'system',\n message: 'Failed to load user roles for validation',\n details: result.ErrorMessage,\n });\n return;\n }\n\n // Group roles by UserID\n for (const userRole of result.Results || []) {\n const userId = userRole.UserID;\n const roleName = userRole.Role;\n\n if (!this.userRoleCache.has(userId)) {\n this.userRoleCache.set(userId, []);\n }\n this.userRoleCache.get(userId)!.push(roleName);\n }\n\n if (this.options.verbose) {\n console.log(`Loaded roles for ${this.userRoleCache.size} users`);\n }\n } catch (error) {\n this.addWarning({\n type: 'validation',\n severity: 'warning',\n file: 'system',\n message: 'Error loading user roles for validation',\n details: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n /**\n * Validate a UserID field value against allowed roles\n */\n private async validateUserRole(userId: string, entityName: string, fieldName: string, filePath: string, config: any): Promise<void> {\n // Skip if user role validation is not enabled\n if (!config.userRoleValidation?.enabled) {\n return;\n }\n\n const userRoles = this.userRoleCache.get(userId);\n const allowedRoles = config.userRoleValidation.allowedRoles || [];\n const allowUsersWithoutRoles = config.userRoleValidation.allowUsersWithoutRoles || false;\n\n if (!userRoles || userRoles.length === 0) {\n if (!allowUsersWithoutRoles) {\n this.addError({\n type: 'validation',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: filePath,\n message: `UserID '${userId}' does not have any assigned roles`,\n suggestion:\n allowedRoles.length > 0\n ? `User must have one of these roles: ${allowedRoles.join(', ')}`\n : 'Assign appropriate roles to this user or set allowUsersWithoutRoles: true',\n });\n }\n return;\n }\n\n // Check if user has at least one allowed role\n if (allowedRoles.length > 0) {\n const hasAllowedRole = userRoles.some((role) => allowedRoles.includes(role));\n if (!hasAllowedRole) {\n this.addError({\n type: 'validation',\n severity: 'error',\n entity: entityName,\n field: fieldName,\n file: filePath,\n message: `UserID '${userId}' has roles [${userRoles.join(', ')}] but none are in allowed list`,\n suggestion: `Allowed roles: ${allowedRoles.join(', ')}`,\n });\n }\n }\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@ export interface ValidationResult {
|
|
|
8
8
|
summary: ValidationSummary;
|
|
9
9
|
}
|
|
10
10
|
export interface ValidationError {
|
|
11
|
-
type: 'entity' | 'field' | 'value' | 'reference' | 'dependency' | 'circular';
|
|
11
|
+
type: 'entity' | 'field' | 'value' | 'reference' | 'dependency' | 'circular' | 'validation';
|
|
12
12
|
severity: 'error';
|
|
13
13
|
entity?: string;
|
|
14
14
|
field?: string;
|
|
@@ -18,7 +18,7 @@ export interface ValidationError {
|
|
|
18
18
|
details?: any;
|
|
19
19
|
}
|
|
20
20
|
export interface ValidationWarning {
|
|
21
|
-
type: 'nesting' | 'naming' | 'bestpractice' | 'performance';
|
|
21
|
+
type: 'nesting' | 'naming' | 'bestpractice' | 'performance' | 'validation';
|
|
22
22
|
severity: 'warning';
|
|
23
23
|
entity?: string;
|
|
24
24
|
field?: string;
|
|
@@ -93,6 +93,10 @@ export interface ParsedReference {
|
|
|
93
93
|
value: string;
|
|
94
94
|
entity?: string;
|
|
95
95
|
field?: string;
|
|
96
|
+
fields?: Array<{
|
|
97
|
+
field: string;
|
|
98
|
+
value: string;
|
|
99
|
+
}>;
|
|
96
100
|
createIfMissing?: boolean;
|
|
97
101
|
additionalFields?: Record<string, any>;
|
|
98
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAuCH;;GAEG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAC3B,IAAI,CAA0B;IAC9B,QAAQ,CAA8B;IACtC,IAAI,CAAS;IACb,MAAM,CAAU;IAChB,KAAK,CAAU;IACf,UAAU,CAAU;IACpB,IAAI,CAAU;IACd,MAAM,CAAU;IAEhC,YAAY,KAAsB;QAC9B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,KAA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,CAAC;gBACd,GAAG,IAAI,YAAY,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,CAAC;YACD,GAAG,IAAI,GAAG,CAAC;QACf,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA5CD,wDA4CC","sourcesContent":["/**\n * Validation types and interfaces for MetadataSync\n */\n\nexport interface ValidationResult {\n isValid: boolean;\n errors: ValidationError[];\n warnings: ValidationWarning[];\n summary: ValidationSummary;\n}\n\nexport interface ValidationError {\n type: 'entity' | 'field' | 'value' | 'reference' | 'dependency' | 'circular';\n severity: 'error';\n entity?: string;\n field?: string;\n file: string;\n message: string;\n suggestion?: string;\n details?: any;\n}\n\nexport interface ValidationWarning {\n type: 'nesting' | 'naming' | 'bestpractice' | 'performance';\n severity: 'warning';\n entity?: string;\n field?: string;\n file: string;\n message: string;\n suggestion?: string;\n details?: any;\n}\n\nexport interface ValidationSummary {\n totalFiles: number;\n totalEntities: number;\n totalErrors: number;\n totalWarnings: number;\n fileResults: Map<string, FileValidationResult>;\n}\n\n/**\n * Custom error class for validation errors\n */\nexport class ValidationErrorClass extends Error {\n public readonly type: ValidationError['type'];\n public readonly severity: ValidationError['severity'];\n public readonly file: string;\n public readonly entity?: string;\n public readonly field?: string;\n public readonly suggestion?: string;\n public readonly line?: number;\n public readonly column?: number;\n \n constructor(error: ValidationError) {\n super(error.message);\n this.name = 'ValidationError';\n this.type = error.type;\n this.severity = error.severity;\n this.file = error.file;\n this.entity = error.entity;\n this.field = error.field;\n this.suggestion = error.suggestion;\n \n // Try to extract line/column from error message if present\n const lineMatch = error.message.match(/line (\\d+)/i);\n const colMatch = error.message.match(/column (\\d+)/i);\n this.line = lineMatch ? parseInt(lineMatch[1]) : undefined;\n this.column = colMatch ? parseInt(colMatch[1]) : undefined;\n \n // Ensure proper prototype chain\n Object.setPrototypeOf(this, ValidationErrorClass.prototype);\n }\n \n /**\n * Get formatted error message with location info\n */\n getFormattedMessage(): string {\n let msg = this.message;\n if (this.line) {\n msg += ` (line ${this.line}`;\n if (this.column) {\n msg += `, column ${this.column}`;\n }\n msg += ')';\n }\n return msg;\n }\n}\n\n/**\n * Custom warning class for validation warnings\n */\nexport class ValidationWarningClass extends Error {\n public readonly type: ValidationWarning['type'];\n public readonly severity: ValidationWarning['severity'];\n public readonly file: string;\n public readonly entity?: string;\n public readonly field?: string;\n public readonly suggestion?: string;\n public readonly line?: number;\n public readonly column?: number;\n \n constructor(warning: ValidationWarning) {\n super(warning.message);\n this.name = 'ValidationWarning';\n this.type = warning.type;\n this.severity = warning.severity;\n this.file = warning.file;\n this.entity = warning.entity;\n this.field = warning.field;\n this.suggestion = warning.suggestion;\n \n // Try to extract line/column from warning message if present\n const lineMatch = warning.message.match(/line (\\d+)/i);\n const colMatch = warning.message.match(/column (\\d+)/i);\n this.line = lineMatch ? parseInt(lineMatch[1]) : undefined;\n this.column = colMatch ? parseInt(colMatch[1]) : undefined;\n \n // Ensure proper prototype chain\n Object.setPrototypeOf(this, ValidationWarningClass.prototype);\n }\n \n /**\n * Get formatted warning message with location info\n */\n getFormattedMessage(): string {\n let msg = this.message;\n if (this.line) {\n msg += ` (line ${this.line}`;\n if (this.column) {\n msg += `, column ${this.column}`;\n }\n msg += ')';\n }\n return msg;\n }\n}\n\nexport interface FileValidationResult {\n file: string;\n entityCount: number;\n errors: ValidationError[];\n warnings: ValidationWarning[];\n}\n\nexport interface EntityDependency {\n entityName: string;\n dependsOn: Set<string>;\n file: string;\n}\n\nexport interface ValidationOptions {\n verbose: boolean;\n outputFormat: 'human' | 'json';\n maxNestingDepth: number;\n checkBestPractices: boolean;\n}\n\nexport type ReferenceType = '@file:' | '@lookup:' | '@template:' | '@parent:' | '@root:' | '@env:';\n\nexport interface ParsedReference {\n type: ReferenceType;\n value: string;\n entity?: string;\n field?: string;\n createIfMissing?: boolean;\n additionalFields?: Record<string, any>;\n}"]}
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings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AAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE3D,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,mBAAmB;QACf,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,GAAG,IAAI,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,GAAG,IAAI,YAAY,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,CAAC;YACD,GAAG,IAAI,GAAG,CAAC;QACf,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA5CD,wDA4CC","sourcesContent":["/**\n * Validation types and interfaces for MetadataSync\n */\n\nexport interface ValidationResult {\n isValid: boolean;\n errors: ValidationError[];\n warnings: ValidationWarning[];\n summary: ValidationSummary;\n}\n\nexport interface ValidationError {\n type: 'entity' | 'field' | 'value' | 'reference' | 'dependency' | 'circular' | 'validation';\n severity: 'error';\n entity?: string;\n field?: string;\n file: string;\n message: string;\n suggestion?: string;\n details?: any;\n}\n\nexport interface ValidationWarning {\n type: 'nesting' | 'naming' | 'bestpractice' | 'performance' | 'validation';\n severity: 'warning';\n entity?: string;\n field?: string;\n file: string;\n message: string;\n suggestion?: string;\n details?: any;\n}\n\nexport interface ValidationSummary {\n totalFiles: number;\n totalEntities: number;\n totalErrors: number;\n totalWarnings: number;\n fileResults: Map<string, FileValidationResult>;\n}\n\n/**\n * Custom error class for validation errors\n */\nexport class ValidationErrorClass extends Error {\n public readonly type: ValidationError['type'];\n public readonly severity: ValidationError['severity'];\n public readonly file: string;\n public readonly entity?: string;\n public readonly field?: string;\n public readonly suggestion?: string;\n public readonly line?: number;\n public readonly column?: number;\n \n constructor(error: ValidationError) {\n super(error.message);\n this.name = 'ValidationError';\n this.type = error.type;\n this.severity = error.severity;\n this.file = error.file;\n this.entity = error.entity;\n this.field = error.field;\n this.suggestion = error.suggestion;\n \n // Try to extract line/column from error message if present\n const lineMatch = error.message.match(/line (\\d+)/i);\n const colMatch = error.message.match(/column (\\d+)/i);\n this.line = lineMatch ? parseInt(lineMatch[1]) : undefined;\n this.column = colMatch ? parseInt(colMatch[1]) : undefined;\n \n // Ensure proper prototype chain\n Object.setPrototypeOf(this, ValidationErrorClass.prototype);\n }\n \n /**\n * Get formatted error message with location info\n */\n getFormattedMessage(): string {\n let msg = this.message;\n if (this.line) {\n msg += ` (line ${this.line}`;\n if (this.column) {\n msg += `, column ${this.column}`;\n }\n msg += ')';\n }\n return msg;\n }\n}\n\n/**\n * Custom warning class for validation warnings\n */\nexport class ValidationWarningClass extends Error {\n public readonly type: ValidationWarning['type'];\n public readonly severity: ValidationWarning['severity'];\n public readonly file: string;\n public readonly entity?: string;\n public readonly field?: string;\n public readonly suggestion?: string;\n public readonly line?: number;\n public readonly column?: number;\n \n constructor(warning: ValidationWarning) {\n super(warning.message);\n this.name = 'ValidationWarning';\n this.type = warning.type;\n this.severity = warning.severity;\n this.file = warning.file;\n this.entity = warning.entity;\n this.field = warning.field;\n this.suggestion = warning.suggestion;\n \n // Try to extract line/column from warning message if present\n const lineMatch = warning.message.match(/line (\\d+)/i);\n const colMatch = warning.message.match(/column (\\d+)/i);\n this.line = lineMatch ? parseInt(lineMatch[1]) : undefined;\n this.column = colMatch ? parseInt(colMatch[1]) : undefined;\n \n // Ensure proper prototype chain\n Object.setPrototypeOf(this, ValidationWarningClass.prototype);\n }\n \n /**\n * Get formatted warning message with location info\n */\n getFormattedMessage(): string {\n let msg = this.message;\n if (this.line) {\n msg += ` (line ${this.line}`;\n if (this.column) {\n msg += `, column ${this.column}`;\n }\n msg += ')';\n }\n return msg;\n }\n}\n\nexport interface FileValidationResult {\n file: string;\n entityCount: number;\n errors: ValidationError[];\n warnings: ValidationWarning[];\n}\n\nexport interface EntityDependency {\n entityName: string;\n dependsOn: Set<string>;\n file: string;\n}\n\nexport interface ValidationOptions {\n verbose: boolean;\n outputFormat: 'human' | 'json';\n maxNestingDepth: number;\n checkBestPractices: boolean;\n}\n\nexport type ReferenceType = '@file:' | '@lookup:' | '@template:' | '@parent:' | '@root:' | '@env:';\n\nexport interface ParsedReference {\n type: ReferenceType;\n value: string;\n entity?: string;\n field?: string;\n fields?: Array<{field: string, value: string}>; // For multi-field lookups\n createIfMissing?: boolean;\n additionalFields?: Record<string, any>;\n}"]}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,76 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {},
|
|
6
|
-
"description": "Initialize a directory for metadata synchronization",
|
|
7
|
-
"examples": [
|
|
8
|
-
"<%= config.bin %> <%= command.id %>"
|
|
9
|
-
],
|
|
10
|
-
"flags": {},
|
|
11
|
-
"hasDynamicHelp": false,
|
|
12
|
-
"hiddenAliases": [],
|
|
13
|
-
"id": "init",
|
|
14
|
-
"pluginAlias": "@memberjunction/metadata-sync",
|
|
15
|
-
"pluginName": "@memberjunction/metadata-sync",
|
|
16
|
-
"pluginType": "core",
|
|
17
|
-
"strict": true,
|
|
18
|
-
"enableJsonFlag": false,
|
|
19
|
-
"isESM": false,
|
|
20
|
-
"relativePath": [
|
|
21
|
-
"dist",
|
|
22
|
-
"commands",
|
|
23
|
-
"init",
|
|
24
|
-
"index.js"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"push": {
|
|
3
|
+
"file-reset": {
|
|
28
4
|
"aliases": [],
|
|
29
5
|
"args": {},
|
|
30
|
-
"description": "
|
|
6
|
+
"description": "Remove primaryKey and sync sections from metadata JSON files",
|
|
31
7
|
"examples": [
|
|
32
8
|
"<%= config.bin %> <%= command.id %>",
|
|
9
|
+
"<%= config.bin %> <%= command.id %> --sections=primaryKey",
|
|
10
|
+
"<%= config.bin %> <%= command.id %> --sections=sync",
|
|
33
11
|
"<%= config.bin %> <%= command.id %> --dry-run",
|
|
34
|
-
"<%= config.bin %> <%= command.id %> --
|
|
35
|
-
"<%= config.bin %> <%= command.id %> --
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --no-backup",
|
|
13
|
+
"<%= config.bin %> <%= command.id %> --yes"
|
|
36
14
|
],
|
|
37
15
|
"flags": {
|
|
38
|
-
"
|
|
39
|
-
"description": "
|
|
40
|
-
"name": "
|
|
16
|
+
"sections": {
|
|
17
|
+
"description": "Which sections to remove",
|
|
18
|
+
"name": "sections",
|
|
19
|
+
"default": "both",
|
|
41
20
|
"hasDynamicHelp": false,
|
|
42
21
|
"multiple": false,
|
|
22
|
+
"options": [
|
|
23
|
+
"both",
|
|
24
|
+
"primaryKey",
|
|
25
|
+
"sync"
|
|
26
|
+
],
|
|
43
27
|
"type": "option"
|
|
44
28
|
},
|
|
45
29
|
"dry-run": {
|
|
46
|
-
"description": "Show what would be
|
|
30
|
+
"description": "Show what would be removed without actually removing",
|
|
47
31
|
"name": "dry-run",
|
|
48
32
|
"allowNo": false,
|
|
49
33
|
"type": "boolean"
|
|
50
34
|
},
|
|
51
|
-
"
|
|
52
|
-
"description": "
|
|
53
|
-
"name": "
|
|
35
|
+
"no-backup": {
|
|
36
|
+
"description": "Skip creating backup files",
|
|
37
|
+
"name": "no-backup",
|
|
54
38
|
"allowNo": false,
|
|
55
39
|
"type": "boolean"
|
|
56
40
|
},
|
|
57
|
-
"
|
|
58
|
-
"char": "
|
|
59
|
-
"description": "
|
|
60
|
-
"name": "
|
|
41
|
+
"yes": {
|
|
42
|
+
"char": "y",
|
|
43
|
+
"description": "Skip confirmation prompt",
|
|
44
|
+
"name": "yes",
|
|
61
45
|
"allowNo": false,
|
|
62
46
|
"type": "boolean"
|
|
63
47
|
},
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
48
|
+
"verbose": {
|
|
49
|
+
"char": "v",
|
|
50
|
+
"description": "Show detailed output",
|
|
51
|
+
"name": "verbose",
|
|
67
52
|
"allowNo": false,
|
|
68
53
|
"type": "boolean"
|
|
69
54
|
}
|
|
70
55
|
},
|
|
71
56
|
"hasDynamicHelp": false,
|
|
72
57
|
"hiddenAliases": [],
|
|
73
|
-
"id": "
|
|
58
|
+
"id": "file-reset",
|
|
74
59
|
"pluginAlias": "@memberjunction/metadata-sync",
|
|
75
60
|
"pluginName": "@memberjunction/metadata-sync",
|
|
76
61
|
"pluginType": "core",
|
|
@@ -80,7 +65,31 @@
|
|
|
80
65
|
"relativePath": [
|
|
81
66
|
"dist",
|
|
82
67
|
"commands",
|
|
83
|
-
"
|
|
68
|
+
"file-reset",
|
|
69
|
+
"index.js"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"init": {
|
|
73
|
+
"aliases": [],
|
|
74
|
+
"args": {},
|
|
75
|
+
"description": "Initialize a directory for metadata synchronization",
|
|
76
|
+
"examples": [
|
|
77
|
+
"<%= config.bin %> <%= command.id %>"
|
|
78
|
+
],
|
|
79
|
+
"flags": {},
|
|
80
|
+
"hasDynamicHelp": false,
|
|
81
|
+
"hiddenAliases": [],
|
|
82
|
+
"id": "init",
|
|
83
|
+
"pluginAlias": "@memberjunction/metadata-sync",
|
|
84
|
+
"pluginName": "@memberjunction/metadata-sync",
|
|
85
|
+
"pluginType": "core",
|
|
86
|
+
"strict": true,
|
|
87
|
+
"enableJsonFlag": false,
|
|
88
|
+
"isESM": false,
|
|
89
|
+
"relativePath": [
|
|
90
|
+
"dist",
|
|
91
|
+
"commands",
|
|
92
|
+
"init",
|
|
84
93
|
"index.js"
|
|
85
94
|
]
|
|
86
95
|
},
|
|
@@ -151,6 +160,66 @@
|
|
|
151
160
|
"index.js"
|
|
152
161
|
]
|
|
153
162
|
},
|
|
163
|
+
"push": {
|
|
164
|
+
"aliases": [],
|
|
165
|
+
"args": {},
|
|
166
|
+
"description": "Push local file changes to the database",
|
|
167
|
+
"examples": [
|
|
168
|
+
"<%= config.bin %> <%= command.id %>",
|
|
169
|
+
"<%= config.bin %> <%= command.id %> --dry-run",
|
|
170
|
+
"<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
|
|
171
|
+
"<%= config.bin %> <%= command.id %> --ci"
|
|
172
|
+
],
|
|
173
|
+
"flags": {
|
|
174
|
+
"dir": {
|
|
175
|
+
"description": "Specific entity directory to push",
|
|
176
|
+
"name": "dir",
|
|
177
|
+
"hasDynamicHelp": false,
|
|
178
|
+
"multiple": false,
|
|
179
|
+
"type": "option"
|
|
180
|
+
},
|
|
181
|
+
"dry-run": {
|
|
182
|
+
"description": "Show what would be pushed without actually pushing",
|
|
183
|
+
"name": "dry-run",
|
|
184
|
+
"allowNo": false,
|
|
185
|
+
"type": "boolean"
|
|
186
|
+
},
|
|
187
|
+
"ci": {
|
|
188
|
+
"description": "CI mode - no prompts, fail on issues",
|
|
189
|
+
"name": "ci",
|
|
190
|
+
"allowNo": false,
|
|
191
|
+
"type": "boolean"
|
|
192
|
+
},
|
|
193
|
+
"verbose": {
|
|
194
|
+
"char": "v",
|
|
195
|
+
"description": "Show detailed field-level output",
|
|
196
|
+
"name": "verbose",
|
|
197
|
+
"allowNo": false,
|
|
198
|
+
"type": "boolean"
|
|
199
|
+
},
|
|
200
|
+
"no-validate": {
|
|
201
|
+
"description": "Skip validation before push",
|
|
202
|
+
"name": "no-validate",
|
|
203
|
+
"allowNo": false,
|
|
204
|
+
"type": "boolean"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"hasDynamicHelp": false,
|
|
208
|
+
"hiddenAliases": [],
|
|
209
|
+
"id": "push",
|
|
210
|
+
"pluginAlias": "@memberjunction/metadata-sync",
|
|
211
|
+
"pluginName": "@memberjunction/metadata-sync",
|
|
212
|
+
"pluginType": "core",
|
|
213
|
+
"strict": true,
|
|
214
|
+
"enableJsonFlag": false,
|
|
215
|
+
"isESM": false,
|
|
216
|
+
"relativePath": [
|
|
217
|
+
"dist",
|
|
218
|
+
"commands",
|
|
219
|
+
"push",
|
|
220
|
+
"index.js"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
154
223
|
"status": {
|
|
155
224
|
"aliases": [],
|
|
156
225
|
"args": {},
|
|
@@ -303,5 +372,5 @@
|
|
|
303
372
|
]
|
|
304
373
|
}
|
|
305
374
|
},
|
|
306
|
-
"version": "2.
|
|
375
|
+
"version": "2.53.0"
|
|
307
376
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/metadata-sync",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"description": "MemberJunction metadata synchronization CLI tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oclif",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@inquirer/prompts": "^5.0.1",
|
|
54
|
-
"@memberjunction/core": "2.
|
|
55
|
-
"@memberjunction/core-entities": "2.
|
|
56
|
-
"@memberjunction/core-entities-server": "2.
|
|
57
|
-
"@memberjunction/global": "2.
|
|
58
|
-
"@memberjunction/sqlserver-dataprovider": "2.
|
|
59
|
-
"@memberjunction/graphql-dataprovider": "2.
|
|
54
|
+
"@memberjunction/core": "2.53.0",
|
|
55
|
+
"@memberjunction/core-entities": "2.53.0",
|
|
56
|
+
"@memberjunction/core-entities-server": "2.53.0",
|
|
57
|
+
"@memberjunction/global": "2.53.0",
|
|
58
|
+
"@memberjunction/sqlserver-dataprovider": "2.53.0",
|
|
59
|
+
"@memberjunction/graphql-dataprovider": "2.53.0",
|
|
60
60
|
"@oclif/core": "^3",
|
|
61
61
|
"@oclif/plugin-help": "^6",
|
|
62
62
|
"@oclif/plugin-version": "^2.0.17",
|