@objectql/core 4.0.2 → 4.0.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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +18 -0
- package/README.md +4 -4
- package/dist/app.d.ts +9 -6
- package/dist/app.js +151 -29
- package/dist/app.js.map +1 -1
- package/dist/index.d.ts +6 -9
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/optimizations/CompiledHookManager.d.ts +55 -0
- package/dist/optimizations/CompiledHookManager.js +164 -0
- package/dist/optimizations/CompiledHookManager.js.map +1 -0
- package/dist/optimizations/DependencyGraph.d.ts +82 -0
- package/dist/optimizations/DependencyGraph.js +211 -0
- package/dist/optimizations/DependencyGraph.js.map +1 -0
- package/dist/optimizations/GlobalConnectionPool.d.ts +89 -0
- package/dist/optimizations/GlobalConnectionPool.js +193 -0
- package/dist/optimizations/GlobalConnectionPool.js.map +1 -0
- package/dist/optimizations/LazyMetadataLoader.d.ts +75 -0
- package/dist/optimizations/LazyMetadataLoader.js +149 -0
- package/dist/optimizations/LazyMetadataLoader.js.map +1 -0
- package/dist/optimizations/OptimizedMetadataRegistry.d.ts +26 -0
- package/dist/optimizations/OptimizedMetadataRegistry.js +117 -0
- package/dist/optimizations/OptimizedMetadataRegistry.js.map +1 -0
- package/dist/optimizations/OptimizedValidationEngine.d.ts +73 -0
- package/dist/optimizations/OptimizedValidationEngine.js +141 -0
- package/dist/optimizations/OptimizedValidationEngine.js.map +1 -0
- package/dist/optimizations/QueryCompiler.d.ts +51 -0
- package/dist/optimizations/QueryCompiler.js +216 -0
- package/dist/optimizations/QueryCompiler.js.map +1 -0
- package/dist/optimizations/SQLQueryOptimizer.d.ts +96 -0
- package/dist/optimizations/SQLQueryOptimizer.js +265 -0
- package/dist/optimizations/SQLQueryOptimizer.js.map +1 -0
- package/dist/optimizations/index.d.ts +32 -0
- package/dist/optimizations/index.js +44 -0
- package/dist/optimizations/index.js.map +1 -0
- package/dist/plugin.d.ts +6 -7
- package/dist/plugin.js +39 -22
- package/dist/plugin.js.map +1 -1
- package/dist/query/query-analyzer.js.map +1 -1
- package/dist/query/query-builder.d.ts +6 -1
- package/dist/query/query-builder.js +21 -5
- package/dist/query/query-builder.js.map +1 -1
- package/dist/query/query-service.js.map +1 -1
- package/dist/repository.d.ts +2 -0
- package/dist/repository.js +15 -9
- package/dist/repository.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +8 -5
- package/src/app.ts +173 -47
- package/src/index.ts +8 -9
- package/src/optimizations/CompiledHookManager.ts +185 -0
- package/src/optimizations/DependencyGraph.ts +255 -0
- package/src/optimizations/GlobalConnectionPool.ts +251 -0
- package/src/optimizations/LazyMetadataLoader.ts +180 -0
- package/src/optimizations/OptimizedMetadataRegistry.ts +132 -0
- package/src/optimizations/OptimizedValidationEngine.ts +172 -0
- package/src/optimizations/QueryCompiler.ts +242 -0
- package/src/optimizations/SQLQueryOptimizer.ts +329 -0
- package/src/optimizations/index.ts +34 -0
- package/src/plugin.ts +51 -28
- package/src/query/query-analyzer.ts +1 -1
- package/src/query/query-builder.ts +21 -7
- package/src/query/query-service.ts +1 -1
- package/src/repository.ts +25 -13
- package/test/__mocks__/@objectstack/runtime.ts +8 -8
- package/test/app.test.ts +9 -7
- package/test/optimizations.test.ts +440 -0
- package/test/plugin-integration.test.ts +30 -19
- package/tsconfig.json +4 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/ai-agent.d.ts +0 -176
- package/dist/ai-agent.js +0 -722
- package/dist/ai-agent.js.map +0 -1
- package/dist/formula-engine.d.ts +0 -102
- package/dist/formula-engine.js +0 -433
- package/dist/formula-engine.js.map +0 -1
- package/dist/formula-plugin.d.ts +0 -52
- package/dist/formula-plugin.js +0 -107
- package/dist/formula-plugin.js.map +0 -1
- package/dist/validator-plugin.d.ts +0 -56
- package/dist/validator-plugin.js +0 -106
- package/dist/validator-plugin.js.map +0 -1
- package/dist/validator.d.ts +0 -80
- package/dist/validator.js +0 -625
- package/dist/validator.js.map +0 -1
- package/src/ai-agent.ts +0 -868
- package/src/formula-engine.ts +0 -572
- package/src/formula-plugin.ts +0 -141
- package/src/validator-plugin.ts +0 -140
- package/src/validator.ts +0 -743
- package/test/formula-engine.test.ts +0 -725
- package/test/formula-integration.test.ts +0 -286
- package/test/formula-plugin.test.ts +0 -197
- package/test/formula-spec-compliance.test.ts +0 -258
- package/test/validation-spec-compliance.test.ts +0 -440
- package/test/validator-plugin.test.ts +0 -126
- package/test/validator.test.ts +0 -440
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { ObjectQLPlugin } from '../src/plugin';
|
|
10
|
-
import { ValidatorPlugin } from '
|
|
11
|
-
import { FormulaPlugin } from '
|
|
10
|
+
import { ValidatorPlugin } from '@objectql/plugin-validator';
|
|
11
|
+
import { FormulaPlugin } from '@objectql/plugin-formula';
|
|
12
12
|
|
|
13
13
|
// Mock the sub-plugins
|
|
14
|
-
jest.mock('
|
|
15
|
-
jest.mock('
|
|
14
|
+
jest.mock('@objectql/plugin-validator');
|
|
15
|
+
jest.mock('@objectql/plugin-formula');
|
|
16
16
|
|
|
17
17
|
describe('ObjectQLPlugin Integration', () => {
|
|
18
18
|
let plugin: ObjectQLPlugin;
|
|
@@ -29,7 +29,7 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
29
29
|
registerFormulaProvider: jest.fn(),
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
mockContext = {
|
|
32
|
+
mockContext = { app: mockKernel };
|
|
33
33
|
|
|
34
34
|
// Setup mock implementations
|
|
35
35
|
(ValidatorPlugin as jest.Mock).mockImplementation(() => ({
|
|
@@ -45,7 +45,7 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
45
45
|
it('should have correct name and version', () => {
|
|
46
46
|
plugin = new ObjectQLPlugin();
|
|
47
47
|
expect(plugin.name).toBe('@objectql/core');
|
|
48
|
-
expect(plugin.version).toBe('4.0.
|
|
48
|
+
expect(plugin.version).toBe('4.0.2');
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -89,32 +89,36 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
89
89
|
describe('Installation - Conditional Plugin Loading', () => {
|
|
90
90
|
it('should install validator plugin when enabled', async () => {
|
|
91
91
|
plugin = new ObjectQLPlugin({ enableValidator: true });
|
|
92
|
-
|
|
92
|
+
const runtimeContext = { engine: mockContext.app };
|
|
93
|
+
await plugin.install(runtimeContext);
|
|
93
94
|
|
|
94
95
|
expect(ValidatorPlugin).toHaveBeenCalled();
|
|
95
96
|
const validatorInstance = (ValidatorPlugin as jest.Mock).mock.results[0].value;
|
|
96
|
-
expect(validatorInstance.install).toHaveBeenCalledWith(
|
|
97
|
+
expect(validatorInstance.install).toHaveBeenCalledWith(runtimeContext);
|
|
97
98
|
});
|
|
98
99
|
|
|
99
100
|
it('should not install validator plugin when disabled', async () => {
|
|
100
101
|
plugin = new ObjectQLPlugin({ enableValidator: false });
|
|
101
|
-
|
|
102
|
+
const runtimeContext = { engine: mockContext.app };
|
|
103
|
+
await plugin.install(runtimeContext);
|
|
102
104
|
|
|
103
105
|
expect(ValidatorPlugin).not.toHaveBeenCalled();
|
|
104
106
|
});
|
|
105
107
|
|
|
106
108
|
it('should install formula plugin when enabled', async () => {
|
|
107
109
|
plugin = new ObjectQLPlugin({ enableFormulas: true });
|
|
108
|
-
|
|
110
|
+
const runtimeContext = { engine: mockContext.app };
|
|
111
|
+
await plugin.install(runtimeContext);
|
|
109
112
|
|
|
110
113
|
expect(FormulaPlugin).toHaveBeenCalled();
|
|
111
114
|
const formulaInstance = (FormulaPlugin as jest.Mock).mock.results[0].value;
|
|
112
|
-
expect(formulaInstance.install).toHaveBeenCalledWith(
|
|
115
|
+
expect(formulaInstance.install).toHaveBeenCalledWith(runtimeContext);
|
|
113
116
|
});
|
|
114
117
|
|
|
115
118
|
it('should not install formula plugin when disabled', async () => {
|
|
116
119
|
plugin = new ObjectQLPlugin({ enableFormulas: false });
|
|
117
|
-
|
|
120
|
+
const runtimeContext = { engine: mockContext.app };
|
|
121
|
+
await plugin.install(runtimeContext);
|
|
118
122
|
|
|
119
123
|
expect(FormulaPlugin).not.toHaveBeenCalled();
|
|
120
124
|
});
|
|
@@ -130,7 +134,8 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
130
134
|
validatorConfig,
|
|
131
135
|
});
|
|
132
136
|
|
|
133
|
-
|
|
137
|
+
const runtimeContext = { engine: mockContext.app };
|
|
138
|
+
await plugin.install(runtimeContext);
|
|
134
139
|
|
|
135
140
|
expect(ValidatorPlugin).toHaveBeenCalledWith(validatorConfig);
|
|
136
141
|
});
|
|
@@ -146,7 +151,8 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
146
151
|
formulaConfig,
|
|
147
152
|
});
|
|
148
153
|
|
|
149
|
-
|
|
154
|
+
const runtimeContext = { engine: mockContext.app };
|
|
155
|
+
await plugin.install(runtimeContext);
|
|
150
156
|
|
|
151
157
|
expect(FormulaPlugin).toHaveBeenCalledWith(formulaConfig);
|
|
152
158
|
});
|
|
@@ -157,7 +163,8 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
157
163
|
enableFormulas: true,
|
|
158
164
|
});
|
|
159
165
|
|
|
160
|
-
|
|
166
|
+
const runtimeContext = { engine: mockContext.app };
|
|
167
|
+
await plugin.install(runtimeContext);
|
|
161
168
|
|
|
162
169
|
expect(ValidatorPlugin).toHaveBeenCalled();
|
|
163
170
|
expect(FormulaPlugin).toHaveBeenCalled();
|
|
@@ -171,7 +178,8 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
171
178
|
enableAI: false,
|
|
172
179
|
});
|
|
173
180
|
|
|
174
|
-
|
|
181
|
+
const runtimeContext = { engine: mockContext.app };
|
|
182
|
+
await plugin.install(runtimeContext);
|
|
175
183
|
|
|
176
184
|
expect(ValidatorPlugin).not.toHaveBeenCalled();
|
|
177
185
|
expect(FormulaPlugin).not.toHaveBeenCalled();
|
|
@@ -183,15 +191,17 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
183
191
|
plugin = new ObjectQLPlugin();
|
|
184
192
|
expect(typeof plugin.onStart).toBe('function');
|
|
185
193
|
|
|
194
|
+
const runtimeContext = { engine: mockContext.app };
|
|
186
195
|
// Should not throw when called
|
|
187
|
-
await expect(plugin.onStart(
|
|
196
|
+
await expect(plugin.onStart(runtimeContext)).resolves.not.toThrow();
|
|
188
197
|
});
|
|
189
198
|
});
|
|
190
199
|
|
|
191
200
|
describe('Default Configuration', () => {
|
|
192
201
|
it('should enable all features by default', async () => {
|
|
193
202
|
plugin = new ObjectQLPlugin();
|
|
194
|
-
|
|
203
|
+
const runtimeContext = { engine: mockContext.app };
|
|
204
|
+
await plugin.install(runtimeContext);
|
|
195
205
|
|
|
196
206
|
// Validator and Formula should be installed by default
|
|
197
207
|
expect(ValidatorPlugin).toHaveBeenCalled();
|
|
@@ -203,7 +213,8 @@ describe('ObjectQLPlugin Integration', () => {
|
|
|
203
213
|
// Explicitly not setting enableValidator or enableFormulas
|
|
204
214
|
});
|
|
205
215
|
|
|
206
|
-
|
|
216
|
+
const runtimeContext = { engine: mockContext.app };
|
|
217
|
+
await plugin.install(runtimeContext);
|
|
207
218
|
|
|
208
219
|
// Both should still be installed
|
|
209
220
|
expect(ValidatorPlugin).toHaveBeenCalled();
|
package/tsconfig.json
CHANGED
|
@@ -7,13 +7,11 @@
|
|
|
7
7
|
"include": ["src/**/*"],
|
|
8
8
|
"exclude": [
|
|
9
9
|
"node_modules",
|
|
10
|
-
"dist"
|
|
11
|
-
// Exclude external @objectstack/objectql package that has type incompatibilities
|
|
12
|
-
// with our stub packages during migration phase
|
|
13
|
-
"../../../node_modules/@objectstack+objectql"
|
|
10
|
+
"dist"
|
|
14
11
|
],
|
|
15
12
|
"references": [
|
|
16
|
-
{ "path": "
|
|
17
|
-
{ "path": "../
|
|
13
|
+
{ "path": "../types" },
|
|
14
|
+
{ "path": "../plugin-validator" },
|
|
15
|
+
{ "path": "../plugin-formula" }
|
|
18
16
|
]
|
|
19
17
|
}
|