@dbcube/schema-builder 1.0.16 → 1.0.18
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/dist/index.cjs +609 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +108 -3
- package/dist/index.d.ts +108 -3
- package/dist/index.js +605 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ declare class Schema {
|
|
|
7
7
|
private engine;
|
|
8
8
|
constructor(name: string);
|
|
9
9
|
/**
|
|
10
|
-
* Validates
|
|
10
|
+
* Validates cube file comprehensively including syntax, database configuration, and structure
|
|
11
11
|
* @param filePath - Path to the cube file
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns validation result with any errors found
|
|
13
13
|
*/
|
|
14
14
|
private validateDatabaseConfiguration;
|
|
15
15
|
/**
|
|
@@ -23,4 +23,109 @@ declare class Schema {
|
|
|
23
23
|
executeTriggers(): Promise<any>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
interface ProcessError {
|
|
27
|
+
itemName: string;
|
|
28
|
+
error: string;
|
|
29
|
+
filePath?: string;
|
|
30
|
+
lineNumber?: number;
|
|
31
|
+
}
|
|
32
|
+
interface ProcessSummary {
|
|
33
|
+
startTime: number;
|
|
34
|
+
totalProcessed: number;
|
|
35
|
+
successCount: number;
|
|
36
|
+
errorCount: number;
|
|
37
|
+
processedItems: string[];
|
|
38
|
+
operationName: string;
|
|
39
|
+
databaseName: string;
|
|
40
|
+
errors: ProcessError[];
|
|
41
|
+
}
|
|
42
|
+
declare class UIUtils {
|
|
43
|
+
/**
|
|
44
|
+
* Shows animated progress for processing items
|
|
45
|
+
*/
|
|
46
|
+
static showItemProgress(itemName: string, current: number, total: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Shows success for a processed item
|
|
49
|
+
*/
|
|
50
|
+
static showItemSuccess(itemName: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Shows error for an item (simplified - only shows X)
|
|
53
|
+
*/
|
|
54
|
+
static showItemError(itemName: string, error: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Shows operation header
|
|
57
|
+
*/
|
|
58
|
+
static showOperationHeader(operationName: string, databaseName: string, icon?: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* Shows comprehensive operation summary
|
|
61
|
+
*/
|
|
62
|
+
static showOperationSummary(summary: ProcessSummary): void;
|
|
63
|
+
/**
|
|
64
|
+
* Shows code context around an error location
|
|
65
|
+
*/
|
|
66
|
+
static showCodeContext(filePath: string, lineNumber: number, contextLines?: number): void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ValidationResult {
|
|
70
|
+
isValid: boolean;
|
|
71
|
+
errors: ProcessError[];
|
|
72
|
+
}
|
|
73
|
+
declare class CubeValidator {
|
|
74
|
+
private validTypes;
|
|
75
|
+
private validOptions;
|
|
76
|
+
private validProperties;
|
|
77
|
+
private knownAnnotations;
|
|
78
|
+
/**
|
|
79
|
+
* Validates a cube file comprehensively
|
|
80
|
+
*/
|
|
81
|
+
validateCubeFile(filePath: string): ValidationResult;
|
|
82
|
+
private validateAnnotations;
|
|
83
|
+
private validateDataTypes;
|
|
84
|
+
private validateColumnOptions;
|
|
85
|
+
private validateColumnProperties;
|
|
86
|
+
private validateRequiredColumnProperties;
|
|
87
|
+
private validateGeneralSyntax;
|
|
88
|
+
private validateOverallStructure;
|
|
89
|
+
private getColumnTypeForOptions;
|
|
90
|
+
private isOptionCompatibleWithType;
|
|
91
|
+
private isInsideColumnsBlock;
|
|
92
|
+
private isInsideForeignKeyObject;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface ExecutionOrder {
|
|
96
|
+
tables: string[];
|
|
97
|
+
seeders: string[];
|
|
98
|
+
timestamp: string;
|
|
99
|
+
}
|
|
100
|
+
declare class DependencyResolver {
|
|
101
|
+
/**
|
|
102
|
+
* Resolves table dependencies and creates execution order
|
|
103
|
+
*/
|
|
104
|
+
static resolveDependencies(cubeFiles: string[], cubeType?: 'table' | 'seeder'): ExecutionOrder;
|
|
105
|
+
/**
|
|
106
|
+
* Extracts dependencies from cube files
|
|
107
|
+
*/
|
|
108
|
+
private static extractDependencies;
|
|
109
|
+
/**
|
|
110
|
+
* Extracts foreign key references from a cube file
|
|
111
|
+
*/
|
|
112
|
+
private static extractForeignKeyReferences;
|
|
113
|
+
/**
|
|
114
|
+
* Performs topological sort to determine execution order
|
|
115
|
+
*/
|
|
116
|
+
private static topologicalSort;
|
|
117
|
+
/**
|
|
118
|
+
* Saves the execution order to .dbcube/orderexecute.json
|
|
119
|
+
*/
|
|
120
|
+
private static saveExecutionOrder;
|
|
121
|
+
/**
|
|
122
|
+
* Loads the execution order from .dbcube/orderexecute.json
|
|
123
|
+
*/
|
|
124
|
+
static loadExecutionOrder(): ExecutionOrder | null;
|
|
125
|
+
/**
|
|
126
|
+
* Orders cube files based on saved execution order
|
|
127
|
+
*/
|
|
128
|
+
static orderCubeFiles(cubeFiles: string[], cubeType: 'table' | 'seeder'): string[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { CubeValidator, DependencyResolver, Schema, UIUtils, Schema as default };
|