@objectql/core 4.2.0 → 4.2.2

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 (116) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +5 -2
  4. package/dist/app.d.ts +61 -52
  5. package/dist/app.js +100 -435
  6. package/dist/app.js.map +1 -1
  7. package/dist/index.d.ts +14 -20
  8. package/dist/index.js +21 -20
  9. package/dist/index.js.map +1 -1
  10. package/dist/kernel-factory.d.ts +38 -0
  11. package/dist/kernel-factory.js +38 -0
  12. package/dist/kernel-factory.js.map +1 -0
  13. package/dist/plugin.d.ts +9 -16
  14. package/dist/plugin.js +71 -48
  15. package/dist/plugin.js.map +1 -1
  16. package/dist/repository.d.ts +4 -31
  17. package/dist/repository.js +7 -283
  18. package/dist/repository.js.map +1 -1
  19. package/dist/util.js +4 -2
  20. package/dist/util.js.map +1 -1
  21. package/package.json +14 -12
  22. package/src/app.ts +156 -539
  23. package/src/index.ts +18 -42
  24. package/src/kernel-factory.ts +47 -0
  25. package/src/plugin.ts +77 -85
  26. package/src/repository.ts +4 -320
  27. package/src/util.ts +5 -3
  28. package/test/__mocks__/@objectstack/core.ts +250 -1
  29. package/test/__mocks__/@objectstack/objectql.ts +273 -0
  30. package/test/__mocks__/@objectstack/runtime.ts +14 -5
  31. package/test/introspection.test.ts +1 -1
  32. package/test/mock-driver.ts +5 -5
  33. package/test/optimizations.test.ts +2 -2
  34. package/test/plugin-integration.test.ts +1 -3
  35. package/test/utils.ts +6 -6
  36. package/tsconfig.json +3 -1
  37. package/tsconfig.tsbuildinfo +1 -1
  38. package/dist/ai/index.d.ts +0 -8
  39. package/dist/ai/index.js +0 -25
  40. package/dist/ai/index.js.map +0 -1
  41. package/dist/ai/registry.d.ts +0 -23
  42. package/dist/ai/registry.js +0 -78
  43. package/dist/ai/registry.js.map +0 -1
  44. package/dist/gateway.d.ts +0 -37
  45. package/dist/gateway.js +0 -93
  46. package/dist/gateway.js.map +0 -1
  47. package/dist/optimizations/CompiledHookManager.d.ts +0 -56
  48. package/dist/optimizations/CompiledHookManager.js +0 -170
  49. package/dist/optimizations/CompiledHookManager.js.map +0 -1
  50. package/dist/optimizations/DependencyGraph.d.ts +0 -82
  51. package/dist/optimizations/DependencyGraph.js +0 -211
  52. package/dist/optimizations/DependencyGraph.js.map +0 -1
  53. package/dist/optimizations/GlobalConnectionPool.d.ts +0 -89
  54. package/dist/optimizations/GlobalConnectionPool.js +0 -193
  55. package/dist/optimizations/GlobalConnectionPool.js.map +0 -1
  56. package/dist/optimizations/LazyMetadataLoader.d.ts +0 -75
  57. package/dist/optimizations/LazyMetadataLoader.js +0 -149
  58. package/dist/optimizations/LazyMetadataLoader.js.map +0 -1
  59. package/dist/optimizations/OptimizedMetadataRegistry.d.ts +0 -26
  60. package/dist/optimizations/OptimizedMetadataRegistry.js +0 -117
  61. package/dist/optimizations/OptimizedMetadataRegistry.js.map +0 -1
  62. package/dist/optimizations/OptimizedValidationEngine.d.ts +0 -73
  63. package/dist/optimizations/OptimizedValidationEngine.js +0 -141
  64. package/dist/optimizations/OptimizedValidationEngine.js.map +0 -1
  65. package/dist/optimizations/QueryCompiler.d.ts +0 -51
  66. package/dist/optimizations/QueryCompiler.js +0 -216
  67. package/dist/optimizations/QueryCompiler.js.map +0 -1
  68. package/dist/optimizations/SQLQueryOptimizer.d.ts +0 -96
  69. package/dist/optimizations/SQLQueryOptimizer.js +0 -265
  70. package/dist/optimizations/SQLQueryOptimizer.js.map +0 -1
  71. package/dist/optimizations/index.d.ts +0 -32
  72. package/dist/optimizations/index.js +0 -44
  73. package/dist/optimizations/index.js.map +0 -1
  74. package/dist/protocol.d.ts +0 -191
  75. package/dist/protocol.js +0 -272
  76. package/dist/protocol.js.map +0 -1
  77. package/dist/query/filter-translator.d.ts +0 -24
  78. package/dist/query/filter-translator.js +0 -38
  79. package/dist/query/filter-translator.js.map +0 -1
  80. package/dist/query/index.d.ts +0 -22
  81. package/dist/query/index.js +0 -39
  82. package/dist/query/index.js.map +0 -1
  83. package/dist/query/query-analyzer.d.ts +0 -186
  84. package/dist/query/query-analyzer.js +0 -348
  85. package/dist/query/query-analyzer.js.map +0 -1
  86. package/dist/query/query-builder.d.ts +0 -27
  87. package/dist/query/query-builder.js +0 -69
  88. package/dist/query/query-builder.js.map +0 -1
  89. package/dist/query/query-service.d.ts +0 -151
  90. package/dist/query/query-service.js +0 -272
  91. package/dist/query/query-service.js.map +0 -1
  92. package/src/ai/index.ts +0 -9
  93. package/src/ai/registry.ts +0 -81
  94. package/src/gateway.ts +0 -105
  95. package/src/optimizations/CompiledHookManager.ts +0 -193
  96. package/src/optimizations/DependencyGraph.ts +0 -255
  97. package/src/optimizations/GlobalConnectionPool.ts +0 -251
  98. package/src/optimizations/LazyMetadataLoader.ts +0 -180
  99. package/src/optimizations/OptimizedMetadataRegistry.ts +0 -132
  100. package/src/optimizations/OptimizedValidationEngine.ts +0 -172
  101. package/src/optimizations/QueryCompiler.ts +0 -242
  102. package/src/optimizations/SQLQueryOptimizer.ts +0 -329
  103. package/src/optimizations/index.ts +0 -34
  104. package/src/protocol.ts +0 -304
  105. package/src/query/filter-translator.ts +0 -41
  106. package/src/query/index.ts +0 -24
  107. package/src/query/query-analyzer.ts +0 -532
  108. package/src/query/query-builder.ts +0 -64
  109. package/src/query/query-service.ts +0 -397
  110. package/test/ai-registry.test.ts +0 -42
  111. package/test/app.test.ts +0 -578
  112. package/test/filter-syntax.test.ts +0 -233
  113. package/test/gateway.test.ts +0 -88
  114. package/test/protocol.test.ts +0 -143
  115. package/test/repository-validation.test.ts +0 -351
  116. 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.2 build /home/runner/work/objectql/objectql/packages/foundation/core
3
3
  > tsc
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @objectql/core
2
2
 
3
+ ## 4.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a30c50: Patch release for all packages
8
+ - @objectql/plugin-formula@4.2.2
9
+ - @objectql/plugin-optimizations@4.2.2
10
+ - @objectql/plugin-query@4.2.2
11
+ - @objectql/plugin-validator@4.2.2
12
+ - @objectql/types@4.2.2
13
+
14
+ ## 4.2.1
15
+
16
+ ### Patch Changes
17
+
18
+ - a0aa26a: Unify all package versions and release a patch
19
+ - Updated dependencies [a0aa26a]
20
+ - @objectql/types@4.2.1
21
+ - @objectql/plugin-formula@4.2.1
22
+ - @objectql/plugin-optimizations@4.2.1
23
+ - @objectql/plugin-query@4.2.1
24
+ - @objectql/plugin-validator@4.2.1
25
+
3
26
  ## 4.2.0
4
27
 
5
28
  ### Minor Changes
@@ -47,6 +70,7 @@
47
70
  This patch release includes bug fixes, driver improvements, and enhanced test coverage:
48
71
 
49
72
  ### Driver Improvements
73
+
50
74
  - **MongoDB Driver**: Fixed bulk operations, transaction support, and type safety improvements
51
75
  - **FileSystem Driver**: Fixed TCK test compatibility with dataDir parameter
52
76
  - **SQL Driver**: Enhanced TCK test compatibility and fixed test failures
@@ -54,22 +78,26 @@
54
78
  - **Driver Utils**: Added shared utilities package for cross-driver functionality
55
79
 
56
80
  ### Testing & Quality
81
+
57
82
  - Added comprehensive TCK (Technology Compatibility Kit) compliance tests for all drivers
58
83
  - Expanded TCK test suite to 30+ comprehensive tests
59
84
  - Enhanced test infrastructure with better error handling
60
85
  - Added --passWithNoTests flag for packages without tests
61
86
 
62
87
  ### Type Safety
88
+
63
89
  - Improved type safety in MongoDB driver update methods
64
90
  - Better handling of atomic operators in MongoDB driver
65
91
  - Enhanced type definitions across driver layer
66
92
 
67
93
  ### Documentation
94
+
68
95
  - Added comprehensive driver documentation
69
96
  - Enhanced official documentation with Phase 2 implementation summaries
70
97
  - Improved protocol layer documentation
71
98
 
72
99
  ### Infrastructure
100
+
73
101
  - Standardized driver layer implementation
74
102
  - Enhanced protocol layer with better abstraction
75
103
  - Improved GitHub Actions workflow configurations
@@ -89,6 +117,7 @@
89
117
  - **Patch Release v4.0.3**
90
118
 
91
119
  This patch release includes infrastructure improvements and development experience enhancements:
120
+
92
121
  - Refactored dev server setup for improved configuration handling
93
122
  - Enhanced example scripts and development workflow
94
123
  - Updated build and test infrastructure
@@ -107,6 +136,7 @@
107
136
  - **Patch Release v4.0.2**
108
137
 
109
138
  This patch release includes:
139
+
110
140
  - Infrastructure improvements and maintenance updates
111
141
  - Enhanced stability and reliability
112
142
  - Bug fixes and performance optimizations
@@ -121,6 +151,7 @@
121
151
  - **Release Version 4.0.1**
122
152
 
123
153
  This patch release includes the latest repository improvements and infrastructure updates:
154
+
124
155
  - Added comprehensive GitHub workflows for CI/CD, testing, and quality assurance
125
156
  - Enhanced documentation and developer experience
126
157
  - Improved build and release processes with Changesets
@@ -138,6 +169,7 @@
138
169
  - 79d04e1: Patch release for January 2026 updates
139
170
 
140
171
  This patch includes minor improvements and maintenance updates:
172
+
141
173
  - Enhanced type safety across core packages
142
174
  - Improved error handling in drivers
143
175
  - Documentation updates
@@ -160,6 +192,7 @@
160
192
  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
193
 
162
194
  ### 🎯 Key Changes
195
+
163
196
  - **Unified Versioning**: All core packages now share the same version number (2.0.0)
164
197
  - **Fixed Group Management**: Updated changeset configuration to include all @objectql packages in the fixed versioning group
165
198
  - **Simplified Maintenance**: Future releases will automatically maintain version consistency across the entire monorepo
@@ -167,6 +200,7 @@
167
200
  ### 📦 Packages Included
168
201
 
169
202
  All ObjectQL packages are now synchronized at version 2.0.0:
203
+
170
204
  - Foundation: `@objectql/types`, `@objectql/core`, `@objectql/platform-node`
171
205
  - 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
206
  - Runtime: `@objectql/server`
package/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # @objectql/core
2
2
 
3
- > **Implementation Status**: **Production Ready** - All core features fully implemented and tested. See [Implementation Status](https://github.com/objectstack-ai/objectql/blob/main/IMPLEMENTATION_STATUS.md) for complete details.
3
+ > ⚠️ **DEPRECATED**: This package is deprecated. Use [`@objectstack/objectql`](https://www.npmjs.com/package/@objectstack/objectql) instead.
4
+ > See the [Migration Guide](https://github.com/objectstack-ai/spec/blob/main/content/docs/guides/objectql-migration.mdx) for step-by-step instructions.
4
5
 
5
- The core ORM and runtime engine for ObjectQL. This package handles object querying, CRUD operations, database driver coordination, transaction management, and **metadata-driven validation**. As of version 4.0.0, it wraps the **ObjectKernel** for plugin architecture and lifecycle management.
6
+ The core ORM and runtime engine for ObjectQL. All core functionality (ObjectQL engine, SchemaRegistry, createObjectQLKernel, utilities) is now available directly from `@objectstack/objectql`.
7
+
8
+ The `ObjectQLPlugin` (orchestrator composing sub-plugins like ValidatorPlugin, FormulaPlugin, QueryPlugin) remains in this package as it is specific to the `@objectql` ecosystem.
6
9
 
7
10
  ## Features
8
11
 
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
  }