@objectql/core 4.1.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 (107) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +42 -0
  3. package/dist/app.d.ts +61 -51
  4. package/dist/app.js +101 -431
  5. package/dist/app.js.map +1 -1
  6. package/dist/index.d.ts +4 -11
  7. package/dist/index.js +13 -9
  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 +10 -16
  13. package/dist/plugin.js +104 -58
  14. package/dist/plugin.js.map +1 -1
  15. package/dist/repository.d.ts +4 -31
  16. package/dist/repository.js +7 -275
  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 +19 -11
  21. package/src/app.ts +157 -531
  22. package/src/index.ts +8 -23
  23. package/src/kernel-factory.ts +47 -0
  24. package/src/plugin.ts +116 -94
  25. package/src/repository.ts +4 -313
  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 +4 -5
  34. package/test/utils.ts +6 -6
  35. package/tsconfig.json +3 -1
  36. package/tsconfig.tsbuildinfo +1 -1
  37. package/dist/gateway.d.ts +0 -36
  38. package/dist/gateway.js +0 -89
  39. package/dist/gateway.js.map +0 -1
  40. package/dist/optimizations/CompiledHookManager.d.ts +0 -55
  41. package/dist/optimizations/CompiledHookManager.js +0 -164
  42. package/dist/optimizations/CompiledHookManager.js.map +0 -1
  43. package/dist/optimizations/DependencyGraph.d.ts +0 -82
  44. package/dist/optimizations/DependencyGraph.js +0 -211
  45. package/dist/optimizations/DependencyGraph.js.map +0 -1
  46. package/dist/optimizations/GlobalConnectionPool.d.ts +0 -89
  47. package/dist/optimizations/GlobalConnectionPool.js +0 -193
  48. package/dist/optimizations/GlobalConnectionPool.js.map +0 -1
  49. package/dist/optimizations/LazyMetadataLoader.d.ts +0 -75
  50. package/dist/optimizations/LazyMetadataLoader.js +0 -149
  51. package/dist/optimizations/LazyMetadataLoader.js.map +0 -1
  52. package/dist/optimizations/OptimizedMetadataRegistry.d.ts +0 -26
  53. package/dist/optimizations/OptimizedMetadataRegistry.js +0 -117
  54. package/dist/optimizations/OptimizedMetadataRegistry.js.map +0 -1
  55. package/dist/optimizations/OptimizedValidationEngine.d.ts +0 -73
  56. package/dist/optimizations/OptimizedValidationEngine.js +0 -141
  57. package/dist/optimizations/OptimizedValidationEngine.js.map +0 -1
  58. package/dist/optimizations/QueryCompiler.d.ts +0 -51
  59. package/dist/optimizations/QueryCompiler.js +0 -216
  60. package/dist/optimizations/QueryCompiler.js.map +0 -1
  61. package/dist/optimizations/SQLQueryOptimizer.d.ts +0 -96
  62. package/dist/optimizations/SQLQueryOptimizer.js +0 -265
  63. package/dist/optimizations/SQLQueryOptimizer.js.map +0 -1
  64. package/dist/optimizations/index.d.ts +0 -32
  65. package/dist/optimizations/index.js +0 -44
  66. package/dist/optimizations/index.js.map +0 -1
  67. package/dist/protocol.d.ts +0 -180
  68. package/dist/protocol.js +0 -260
  69. package/dist/protocol.js.map +0 -1
  70. package/dist/query/filter-translator.d.ts +0 -27
  71. package/dist/query/filter-translator.js +0 -38
  72. package/dist/query/filter-translator.js.map +0 -1
  73. package/dist/query/index.d.ts +0 -22
  74. package/dist/query/index.js +0 -39
  75. package/dist/query/index.js.map +0 -1
  76. package/dist/query/query-analyzer.d.ts +0 -188
  77. package/dist/query/query-analyzer.js +0 -348
  78. package/dist/query/query-analyzer.js.map +0 -1
  79. package/dist/query/query-builder.d.ts +0 -35
  80. package/dist/query/query-builder.js +0 -61
  81. package/dist/query/query-builder.js.map +0 -1
  82. package/dist/query/query-service.d.ts +0 -153
  83. package/dist/query/query-service.js +0 -272
  84. package/dist/query/query-service.js.map +0 -1
  85. package/jest.config.js +0 -29
  86. package/src/gateway.ts +0 -101
  87. package/src/optimizations/CompiledHookManager.ts +0 -185
  88. package/src/optimizations/DependencyGraph.ts +0 -255
  89. package/src/optimizations/GlobalConnectionPool.ts +0 -251
  90. package/src/optimizations/LazyMetadataLoader.ts +0 -180
  91. package/src/optimizations/OptimizedMetadataRegistry.ts +0 -132
  92. package/src/optimizations/OptimizedValidationEngine.ts +0 -172
  93. package/src/optimizations/QueryCompiler.ts +0 -242
  94. package/src/optimizations/SQLQueryOptimizer.ts +0 -329
  95. package/src/optimizations/index.ts +0 -34
  96. package/src/protocol.ts +0 -291
  97. package/src/query/filter-translator.ts +0 -41
  98. package/src/query/index.ts +0 -24
  99. package/src/query/query-analyzer.ts +0 -533
  100. package/src/query/query-builder.ts +0 -64
  101. package/src/query/query-service.ts +0 -398
  102. package/test/app.test.ts +0 -578
  103. package/test/filter-syntax.test.ts +0 -233
  104. package/test/gateway.test.ts +0 -88
  105. package/test/protocol.test.ts +0 -143
  106. package/test/repository-validation.test.ts +0 -351
  107. package/test/repository.test.ts +0 -151
@@ -1,4 +1,4 @@
1
1
 
2
- > @objectql/core@4.1.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,36 @@
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
+
15
+ ## 4.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - Release v4.2.0
20
+ - Protocol layer: Added GraphQL, JSON-RPC, and OData v4 protocol adapters
21
+ - Drivers: Added Excel, filesystem, and Redis drivers
22
+ - Plugins: Added formula engine, security RBAC, and validator plugins
23
+ - CLI: Added `objectql create` scaffolding tool
24
+ - Core: Performance improvements and strict type enforcement
25
+ - Testing: Added Driver TCK and Protocol TCK conformance suites
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+ - @objectql/types@4.2.0
31
+ - @objectql/plugin-formula@4.2.0
32
+ - @objectql/plugin-validator@4.2.0
33
+
3
34
  ## 4.0.6
4
35
 
5
36
  ### Patch Changes
@@ -28,6 +59,7 @@
28
59
  This patch release includes bug fixes, driver improvements, and enhanced test coverage:
29
60
 
30
61
  ### Driver Improvements
62
+
31
63
  - **MongoDB Driver**: Fixed bulk operations, transaction support, and type safety improvements
32
64
  - **FileSystem Driver**: Fixed TCK test compatibility with dataDir parameter
33
65
  - **SQL Driver**: Enhanced TCK test compatibility and fixed test failures
@@ -35,22 +67,26 @@
35
67
  - **Driver Utils**: Added shared utilities package for cross-driver functionality
36
68
 
37
69
  ### Testing & Quality
70
+
38
71
  - Added comprehensive TCK (Technology Compatibility Kit) compliance tests for all drivers
39
72
  - Expanded TCK test suite to 30+ comprehensive tests
40
73
  - Enhanced test infrastructure with better error handling
41
74
  - Added --passWithNoTests flag for packages without tests
42
75
 
43
76
  ### Type Safety
77
+
44
78
  - Improved type safety in MongoDB driver update methods
45
79
  - Better handling of atomic operators in MongoDB driver
46
80
  - Enhanced type definitions across driver layer
47
81
 
48
82
  ### Documentation
83
+
49
84
  - Added comprehensive driver documentation
50
85
  - Enhanced official documentation with Phase 2 implementation summaries
51
86
  - Improved protocol layer documentation
52
87
 
53
88
  ### Infrastructure
89
+
54
90
  - Standardized driver layer implementation
55
91
  - Enhanced protocol layer with better abstraction
56
92
  - Improved GitHub Actions workflow configurations
@@ -70,6 +106,7 @@
70
106
  - **Patch Release v4.0.3**
71
107
 
72
108
  This patch release includes infrastructure improvements and development experience enhancements:
109
+
73
110
  - Refactored dev server setup for improved configuration handling
74
111
  - Enhanced example scripts and development workflow
75
112
  - Updated build and test infrastructure
@@ -88,6 +125,7 @@
88
125
  - **Patch Release v4.0.2**
89
126
 
90
127
  This patch release includes:
128
+
91
129
  - Infrastructure improvements and maintenance updates
92
130
  - Enhanced stability and reliability
93
131
  - Bug fixes and performance optimizations
@@ -102,6 +140,7 @@
102
140
  - **Release Version 4.0.1**
103
141
 
104
142
  This patch release includes the latest repository improvements and infrastructure updates:
143
+
105
144
  - Added comprehensive GitHub workflows for CI/CD, testing, and quality assurance
106
145
  - Enhanced documentation and developer experience
107
146
  - Improved build and release processes with Changesets
@@ -119,6 +158,7 @@
119
158
  - 79d04e1: Patch release for January 2026 updates
120
159
 
121
160
  This patch includes minor improvements and maintenance updates:
161
+
122
162
  - Enhanced type safety across core packages
123
163
  - Improved error handling in drivers
124
164
  - Documentation updates
@@ -141,6 +181,7 @@
141
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.
142
182
 
143
183
  ### 🎯 Key Changes
184
+
144
185
  - **Unified Versioning**: All core packages now share the same version number (2.0.0)
145
186
  - **Fixed Group Management**: Updated changeset configuration to include all @objectql packages in the fixed versioning group
146
187
  - **Simplified Maintenance**: Future releases will automatically maintain version consistency across the entire monorepo
@@ -148,6 +189,7 @@
148
189
  ### 📦 Packages Included
149
190
 
150
191
  All ObjectQL packages are now synchronized at version 2.0.0:
192
+
151
193
  - Foundation: `@objectql/types`, `@objectql/core`, `@objectql/platform-node`
152
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`
153
195
  - Runtime: `@objectql/server`
package/dist/app.d.ts CHANGED
@@ -1,65 +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 config;
26
- constructor(config: ObjectQLConfig);
27
- use(plugin: Plugin): void;
28
- removePackage(name: string): void;
29
- on(event: HookName, objectName: string, handler: HookHandler, packageName?: string): void;
30
- triggerHook(event: HookName, objectName: string, ctx: HookContext): Promise<void>;
31
- registerAction(objectName: string, actionName: string, handler: ActionHandler, packageName?: string): void;
32
- executeAction(objectName: string, actionName: string, ctx: ActionContext): Promise<any>;
33
- 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);
34
43
  /**
35
- * Get the underlying ObjectKernel instance
44
+ * Initialize the engine.
36
45
  *
37
- * This provides access to the kernel for advanced usage scenarios
38
- * 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.
39
57
  *
40
- * @returns The ObjectKernel instance
41
- * @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).
42
61
  */
43
- getKernel(): ObjectKernel;
44
- registerObject(object: ObjectConfig): void;
45
- unregisterObject(name: string): void;
46
- getObject(name: string): ObjectConfig | undefined;
47
- getConfigs(): Record<string, ObjectConfig>;
48
- datasource(name: string): Driver;
62
+ getObject(name: string): ServiceObject | undefined;
49
63
  /**
50
- * Introspect the database schema and automatically register objects.
51
- * This allows connecting to an existing database without defining metadata.
64
+ * Get all registered object configs as a name→config map.
52
65
  *
53
- * @param datasourceName - The name of the datasource to introspect (default: 'default')
54
- * @param options - Optional configuration for schema conversion
55
- * @returns Array of registered ObjectConfig
66
+ * Merges results from the upstream SchemaRegistry with the
67
+ * local MetadataRegistry (for pre-init objects).
56
68
  */
57
- introspectAndRegister(datasourceName?: string, options?: {
58
- excludeTables?: string[];
59
- includeTables?: string[];
60
- skipSystemColumns?: boolean;
61
- }): Promise<ObjectConfig[]>;
62
- close(): Promise<void>;
63
- init(): Promise<void>;
64
- 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;
65
75
  }