@objectql/core 4.2.0 → 4.2.1

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.
Files changed (115) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +23 -0
  3. package/dist/app.d.ts +61 -52
  4. package/dist/app.js +101 -435
  5. package/dist/app.js.map +1 -1
  6. package/dist/index.d.ts +4 -18
  7. package/dist/index.js +11 -18
  8. package/dist/index.js.map +1 -1
  9. package/dist/kernel-factory.d.ts +38 -0
  10. package/dist/kernel-factory.js +38 -0
  11. package/dist/kernel-factory.js.map +1 -0
  12. package/dist/plugin.d.ts +9 -16
  13. package/dist/plugin.js +71 -48
  14. package/dist/plugin.js.map +1 -1
  15. package/dist/repository.d.ts +4 -31
  16. package/dist/repository.js +7 -283
  17. package/dist/repository.js.map +1 -1
  18. package/dist/util.js +4 -2
  19. package/dist/util.js.map +1 -1
  20. package/package.json +12 -11
  21. package/src/app.ts +157 -539
  22. package/src/index.ts +8 -40
  23. package/src/kernel-factory.ts +47 -0
  24. package/src/plugin.ts +77 -85
  25. package/src/repository.ts +4 -320
  26. package/src/util.ts +5 -3
  27. package/test/__mocks__/@objectstack/core.ts +250 -1
  28. package/test/__mocks__/@objectstack/objectql.ts +127 -0
  29. package/test/__mocks__/@objectstack/runtime.ts +14 -5
  30. package/test/introspection.test.ts +1 -1
  31. package/test/mock-driver.ts +5 -5
  32. package/test/optimizations.test.ts +2 -2
  33. package/test/plugin-integration.test.ts +1 -3
  34. package/test/utils.ts +6 -6
  35. package/tsconfig.json +3 -1
  36. package/tsconfig.tsbuildinfo +1 -1
  37. package/dist/ai/index.d.ts +0 -8
  38. package/dist/ai/index.js +0 -25
  39. package/dist/ai/index.js.map +0 -1
  40. package/dist/ai/registry.d.ts +0 -23
  41. package/dist/ai/registry.js +0 -78
  42. package/dist/ai/registry.js.map +0 -1
  43. package/dist/gateway.d.ts +0 -37
  44. package/dist/gateway.js +0 -93
  45. package/dist/gateway.js.map +0 -1
  46. package/dist/optimizations/CompiledHookManager.d.ts +0 -56
  47. package/dist/optimizations/CompiledHookManager.js +0 -170
  48. package/dist/optimizations/CompiledHookManager.js.map +0 -1
  49. package/dist/optimizations/DependencyGraph.d.ts +0 -82
  50. package/dist/optimizations/DependencyGraph.js +0 -211
  51. package/dist/optimizations/DependencyGraph.js.map +0 -1
  52. package/dist/optimizations/GlobalConnectionPool.d.ts +0 -89
  53. package/dist/optimizations/GlobalConnectionPool.js +0 -193
  54. package/dist/optimizations/GlobalConnectionPool.js.map +0 -1
  55. package/dist/optimizations/LazyMetadataLoader.d.ts +0 -75
  56. package/dist/optimizations/LazyMetadataLoader.js +0 -149
  57. package/dist/optimizations/LazyMetadataLoader.js.map +0 -1
  58. package/dist/optimizations/OptimizedMetadataRegistry.d.ts +0 -26
  59. package/dist/optimizations/OptimizedMetadataRegistry.js +0 -117
  60. package/dist/optimizations/OptimizedMetadataRegistry.js.map +0 -1
  61. package/dist/optimizations/OptimizedValidationEngine.d.ts +0 -73
  62. package/dist/optimizations/OptimizedValidationEngine.js +0 -141
  63. package/dist/optimizations/OptimizedValidationEngine.js.map +0 -1
  64. package/dist/optimizations/QueryCompiler.d.ts +0 -51
  65. package/dist/optimizations/QueryCompiler.js +0 -216
  66. package/dist/optimizations/QueryCompiler.js.map +0 -1
  67. package/dist/optimizations/SQLQueryOptimizer.d.ts +0 -96
  68. package/dist/optimizations/SQLQueryOptimizer.js +0 -265
  69. package/dist/optimizations/SQLQueryOptimizer.js.map +0 -1
  70. package/dist/optimizations/index.d.ts +0 -32
  71. package/dist/optimizations/index.js +0 -44
  72. package/dist/optimizations/index.js.map +0 -1
  73. package/dist/protocol.d.ts +0 -191
  74. package/dist/protocol.js +0 -272
  75. package/dist/protocol.js.map +0 -1
  76. package/dist/query/filter-translator.d.ts +0 -24
  77. package/dist/query/filter-translator.js +0 -38
  78. package/dist/query/filter-translator.js.map +0 -1
  79. package/dist/query/index.d.ts +0 -22
  80. package/dist/query/index.js +0 -39
  81. package/dist/query/index.js.map +0 -1
  82. package/dist/query/query-analyzer.d.ts +0 -186
  83. package/dist/query/query-analyzer.js +0 -348
  84. package/dist/query/query-analyzer.js.map +0 -1
  85. package/dist/query/query-builder.d.ts +0 -27
  86. package/dist/query/query-builder.js +0 -69
  87. package/dist/query/query-builder.js.map +0 -1
  88. package/dist/query/query-service.d.ts +0 -151
  89. package/dist/query/query-service.js +0 -272
  90. package/dist/query/query-service.js.map +0 -1
  91. package/src/ai/index.ts +0 -9
  92. package/src/ai/registry.ts +0 -81
  93. package/src/gateway.ts +0 -105
  94. package/src/optimizations/CompiledHookManager.ts +0 -193
  95. package/src/optimizations/DependencyGraph.ts +0 -255
  96. package/src/optimizations/GlobalConnectionPool.ts +0 -251
  97. package/src/optimizations/LazyMetadataLoader.ts +0 -180
  98. package/src/optimizations/OptimizedMetadataRegistry.ts +0 -132
  99. package/src/optimizations/OptimizedValidationEngine.ts +0 -172
  100. package/src/optimizations/QueryCompiler.ts +0 -242
  101. package/src/optimizations/SQLQueryOptimizer.ts +0 -329
  102. package/src/optimizations/index.ts +0 -34
  103. package/src/protocol.ts +0 -304
  104. package/src/query/filter-translator.ts +0 -41
  105. package/src/query/index.ts +0 -24
  106. package/src/query/query-analyzer.ts +0 -532
  107. package/src/query/query-builder.ts +0 -64
  108. package/src/query/query-service.ts +0 -397
  109. package/test/ai-registry.test.ts +0 -42
  110. package/test/app.test.ts +0 -578
  111. package/test/filter-syntax.test.ts +0 -233
  112. package/test/gateway.test.ts +0 -88
  113. package/test/protocol.test.ts +0 -143
  114. package/test/repository-validation.test.ts +0 -351
  115. package/test/repository.test.ts +0 -151
@@ -1,4 +1,4 @@
1
1
 
2
- > @objectql/core@4.2.0 build /home/runner/work/objectql/objectql/packages/foundation/core
2
+ > @objectql/core@4.2.1 build /home/runner/work/objectql/objectql/packages/foundation/core
3
3
  > tsc
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @objectql/core
2
2
 
3
+ ## 4.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a0aa26a: Unify all package versions and release a patch
8
+ - Updated dependencies [a0aa26a]
9
+ - @objectql/types@4.2.1
10
+ - @objectql/plugin-formula@4.2.1
11
+ - @objectql/plugin-optimizations@4.2.1
12
+ - @objectql/plugin-query@4.2.1
13
+ - @objectql/plugin-validator@4.2.1
14
+
3
15
  ## 4.2.0
4
16
 
5
17
  ### Minor Changes
@@ -47,6 +59,7 @@
47
59
  This patch release includes bug fixes, driver improvements, and enhanced test coverage:
48
60
 
49
61
  ### Driver Improvements
62
+
50
63
  - **MongoDB Driver**: Fixed bulk operations, transaction support, and type safety improvements
51
64
  - **FileSystem Driver**: Fixed TCK test compatibility with dataDir parameter
52
65
  - **SQL Driver**: Enhanced TCK test compatibility and fixed test failures
@@ -54,22 +67,26 @@
54
67
  - **Driver Utils**: Added shared utilities package for cross-driver functionality
55
68
 
56
69
  ### Testing & Quality
70
+
57
71
  - Added comprehensive TCK (Technology Compatibility Kit) compliance tests for all drivers
58
72
  - Expanded TCK test suite to 30+ comprehensive tests
59
73
  - Enhanced test infrastructure with better error handling
60
74
  - Added --passWithNoTests flag for packages without tests
61
75
 
62
76
  ### Type Safety
77
+
63
78
  - Improved type safety in MongoDB driver update methods
64
79
  - Better handling of atomic operators in MongoDB driver
65
80
  - Enhanced type definitions across driver layer
66
81
 
67
82
  ### Documentation
83
+
68
84
  - Added comprehensive driver documentation
69
85
  - Enhanced official documentation with Phase 2 implementation summaries
70
86
  - Improved protocol layer documentation
71
87
 
72
88
  ### Infrastructure
89
+
73
90
  - Standardized driver layer implementation
74
91
  - Enhanced protocol layer with better abstraction
75
92
  - Improved GitHub Actions workflow configurations
@@ -89,6 +106,7 @@
89
106
  - **Patch Release v4.0.3**
90
107
 
91
108
  This patch release includes infrastructure improvements and development experience enhancements:
109
+
92
110
  - Refactored dev server setup for improved configuration handling
93
111
  - Enhanced example scripts and development workflow
94
112
  - Updated build and test infrastructure
@@ -107,6 +125,7 @@
107
125
  - **Patch Release v4.0.2**
108
126
 
109
127
  This patch release includes:
128
+
110
129
  - Infrastructure improvements and maintenance updates
111
130
  - Enhanced stability and reliability
112
131
  - Bug fixes and performance optimizations
@@ -121,6 +140,7 @@
121
140
  - **Release Version 4.0.1**
122
141
 
123
142
  This patch release includes the latest repository improvements and infrastructure updates:
143
+
124
144
  - Added comprehensive GitHub workflows for CI/CD, testing, and quality assurance
125
145
  - Enhanced documentation and developer experience
126
146
  - Improved build and release processes with Changesets
@@ -138,6 +158,7 @@
138
158
  - 79d04e1: Patch release for January 2026 updates
139
159
 
140
160
  This patch includes minor improvements and maintenance updates:
161
+
141
162
  - Enhanced type safety across core packages
142
163
  - Improved error handling in drivers
143
164
  - Documentation updates
@@ -160,6 +181,7 @@
160
181
  This is a coordinated major release that unifies all ObjectQL packages to version 2.0.0, establishing a synchronized versioning strategy across the entire ecosystem.
161
182
 
162
183
  ### 🎯 Key Changes
184
+
163
185
  - **Unified Versioning**: All core packages now share the same version number (2.0.0)
164
186
  - **Fixed Group Management**: Updated changeset configuration to include all @objectql packages in the fixed versioning group
165
187
  - **Simplified Maintenance**: Future releases will automatically maintain version consistency across the entire monorepo
@@ -167,6 +189,7 @@
167
189
  ### 📦 Packages Included
168
190
 
169
191
  All ObjectQL packages are now synchronized at version 2.0.0:
192
+
170
193
  - Foundation: `@objectql/types`, `@objectql/core`, `@objectql/platform-node`
171
194
  - Drivers: `@objectql/driver-sql`, `@objectql/driver-mongo`, `@objectql/driver-redis`, `@objectql/driver-fs`, `@objectql/driver-memory`, `@objectql/driver-localstorage`, `@objectql/driver-excel`, `@objectql/sdk`
172
195
  - Runtime: `@objectql/server`
package/dist/app.d.ts CHANGED
@@ -1,66 +1,75 @@
1
1
  /**
2
- * ObjectQL
2
+ * ObjectQL Bridge Class
3
3
  * Copyright (c) 2026-present ObjectStack Inc.
4
4
  *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
5
+ * Extends the upstream @objectstack/objectql.ObjectQL engine with:
6
+ * - Legacy constructor config (datasources map)
7
+ * - MetadataRegistry integration (for ObjectLoader filesystem loading)
8
+ *
9
+ * This allows existing consumers to keep using:
10
+ * const app = new ObjectQL({ datasources: { default: driver } });
11
+ * const loader = new ObjectLoader(app.metadata);
12
+ * await loader.load(dir);
13
+ * await app.init();
7
14
  */
8
- import { MetadataRegistry, Driver, ObjectConfig, ObjectQLContext, ObjectQLContextOptions, IObjectQL, ObjectQLConfig, HookName, HookHandler, HookContext, ActionHandler, ActionContext } from '@objectql/types';
9
- import { ObjectKernel, type Plugin } from '@objectstack/runtime';
15
+ import { ObjectQL as UpstreamObjectQL } from '@objectstack/objectql';
16
+ import type { ServiceObject } from '@objectstack/spec/data';
17
+ import type { DriverInterface } from '@objectstack/core';
18
+ import { MetadataRegistry } from '@objectql/types';
19
+ import type { Driver } from '@objectql/types';
10
20
  /**
11
- * ObjectQL
12
- *
13
- * ObjectQL implementation that wraps ObjectKernel
14
- * to provide the plugin architecture.
21
+ * Legacy config shape accepted by the ObjectQL bridge constructor.
22
+ */
23
+ export interface ObjectQLConfig {
24
+ datasources?: Record<string, Driver | DriverInterface>;
25
+ [key: string]: unknown;
26
+ }
27
+ /**
28
+ * ObjectQL — drop-in replacement that bridges the upstream engine
29
+ * with the @objectql/types MetadataRegistry used by ObjectLoader.
15
30
  */
16
- export declare class ObjectQL implements IObjectQL {
17
- get metadata(): MetadataRegistry;
18
- private datasources;
19
- private remotes;
20
- private kernel;
21
- private ql;
22
- private kernelPlugins;
23
- private hookManager;
24
- private localActions;
25
- private logger;
26
- private config;
27
- constructor(config: ObjectQLConfig);
28
- use(plugin: Plugin): void;
29
- removePackage(name: string): void;
30
- on(event: HookName, objectName: string, handler: HookHandler, packageName?: string): void;
31
- triggerHook(event: HookName, objectName: string, ctx: HookContext): Promise<void>;
32
- registerAction(objectName: string, actionName: string, handler: ActionHandler, packageName?: string): void;
33
- executeAction(objectName: string, actionName: string, ctx: ActionContext): Promise<any>;
34
- createContext(options: ObjectQLContextOptions): ObjectQLContext;
31
+ export declare class ObjectQL extends UpstreamObjectQL {
32
+ /**
33
+ * Filesystem metadata registry populated by ObjectLoader.
34
+ * After calling loader.load(), call app.init() to sync these
35
+ * entries into the upstream SchemaRegistry & driver layer.
36
+ */
37
+ readonly metadata: MetadataRegistry;
38
+ /** Typed self-reference for compat methods */
39
+ private get compat();
40
+ private pendingDrivers;
41
+ registerObject: (schema: ServiceObject, packageId?: string, namespace?: string) => string;
42
+ constructor(config?: ObjectQLConfig);
35
43
  /**
36
- * Get the underlying ObjectKernel instance
44
+ * Initialize the engine.
37
45
  *
38
- * This provides access to the kernel for advanced usage scenarios
39
- * where you need direct access to the plugin architecture.
46
+ * Before calling the upstream init (which connects drivers and syncs schemas),
47
+ * bridge all objects loaded via ObjectLoader into the upstream SchemaRegistry.
48
+ */
49
+ init(): Promise<void>;
50
+ /**
51
+ * Sync all filesystem-loaded metadata into the upstream SchemaRegistry.
52
+ * Called automatically by init(), but can also be called manually.
53
+ */
54
+ private syncMetadataToRegistry;
55
+ /**
56
+ * Get an object definition by name.
40
57
  *
41
- * @returns The ObjectKernel instance
42
- * @throws Error if called before init()
58
+ * Checks the upstream SchemaRegistry first, then falls back to the
59
+ * local MetadataRegistry for objects loaded via ObjectLoader but
60
+ * not yet synced (i.e., init() hasn't been called yet).
43
61
  */
44
- getKernel(): ObjectKernel;
45
- registerObject(object: ObjectConfig): void;
46
- unregisterObject(name: string): void;
47
- getObject(name: string): ObjectConfig | undefined;
48
- getConfigs(): Record<string, ObjectConfig>;
49
- datasource(name: string): Driver;
62
+ getObject(name: string): ServiceObject | undefined;
50
63
  /**
51
- * Introspect the database schema and automatically register objects.
52
- * This allows connecting to an existing database without defining metadata.
64
+ * Get all registered object configs as a name→config map.
53
65
  *
54
- * @param datasourceName - The name of the datasource to introspect (default: 'default')
55
- * @param options - Optional configuration for schema conversion
56
- * @returns Array of registered ObjectConfig
66
+ * Merges results from the upstream SchemaRegistry with the
67
+ * local MetadataRegistry (for pre-init objects).
57
68
  */
58
- introspectAndRegister(datasourceName?: string, options?: {
59
- excludeTables?: string[];
60
- includeTables?: string[];
61
- skipSystemColumns?: boolean;
62
- }): Promise<ObjectConfig[]>;
63
- close(): Promise<void>;
64
- init(): Promise<void>;
65
- private processInitialData;
69
+ getConfigs(): Record<string, ServiceObject>;
70
+ /**
71
+ * Remove all hooks, actions, and objects contributed by a package.
72
+ * Also cleans up the local MetadataRegistry.
73
+ */
74
+ removePackage(packageId: string): void;
66
75
  }