@dbcube/schema-builder 5.0.13 → 5.1.3

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