@objectql/core 4.0.4 → 4.0.5
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 +1 -1
- package/CHANGELOG.md +54 -0
- package/dist/plugin.js +8 -0
- package/dist/plugin.js.map +1 -1
- package/dist/protocol.d.ts +149 -0
- package/dist/protocol.js +224 -0
- package/dist/protocol.js.map +1 -0
- package/package.json +8 -8
- package/src/plugin.ts +10 -0
- package/src/protocol.ts +249 -0
- package/test/protocol.test.ts +143 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @objectql/core
|
|
2
2
|
|
|
3
|
+
## 4.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Patch release 4.0.5 - Bug fixes and stability improvements
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @objectql/plugin-formula@4.0.5
|
|
10
|
+
- @objectql/plugin-validator@4.0.5
|
|
11
|
+
- @objectql/types@4.0.5
|
|
12
|
+
|
|
13
|
+
## 4.0.4
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- **Patch Release v4.0.4**
|
|
18
|
+
|
|
19
|
+
This patch release includes bug fixes, driver improvements, and enhanced test coverage:
|
|
20
|
+
|
|
21
|
+
### Driver Improvements
|
|
22
|
+
- **MongoDB Driver**: Fixed bulk operations, transaction support, and type safety improvements
|
|
23
|
+
- **FileSystem Driver**: Fixed TCK test compatibility with dataDir parameter
|
|
24
|
+
- **SQL Driver**: Enhanced TCK test compatibility and fixed test failures
|
|
25
|
+
- **Redis Driver**: Improved TCK test configuration and dependencies
|
|
26
|
+
- **Driver Utils**: Added shared utilities package for cross-driver functionality
|
|
27
|
+
|
|
28
|
+
### Testing & Quality
|
|
29
|
+
- Added comprehensive TCK (Technology Compatibility Kit) compliance tests for all drivers
|
|
30
|
+
- Expanded TCK test suite to 30+ comprehensive tests
|
|
31
|
+
- Enhanced test infrastructure with better error handling
|
|
32
|
+
- Added --passWithNoTests flag for packages without tests
|
|
33
|
+
|
|
34
|
+
### Type Safety
|
|
35
|
+
- Improved type safety in MongoDB driver update methods
|
|
36
|
+
- Better handling of atomic operators in MongoDB driver
|
|
37
|
+
- Enhanced type definitions across driver layer
|
|
38
|
+
|
|
39
|
+
### Documentation
|
|
40
|
+
- Added comprehensive driver documentation
|
|
41
|
+
- Enhanced official documentation with Phase 2 implementation summaries
|
|
42
|
+
- Improved protocol layer documentation
|
|
43
|
+
|
|
44
|
+
### Infrastructure
|
|
45
|
+
- Standardized driver layer implementation
|
|
46
|
+
- Enhanced protocol layer with better abstraction
|
|
47
|
+
- Improved GitHub Actions workflow configurations
|
|
48
|
+
- Better CI/CD pipeline stability
|
|
49
|
+
|
|
50
|
+
This release maintains full backward compatibility with v4.0.3.
|
|
51
|
+
|
|
52
|
+
- Updated dependencies
|
|
53
|
+
- @objectql/plugin-formula@4.0.4
|
|
54
|
+
- @objectql/plugin-validator@4.0.4
|
|
55
|
+
- @objectql/types@4.0.4
|
|
56
|
+
|
|
3
57
|
## 4.0.3
|
|
4
58
|
|
|
5
59
|
### Patch Changes
|
package/dist/plugin.js
CHANGED
|
@@ -12,6 +12,7 @@ const plugin_validator_1 = require("@objectql/plugin-validator");
|
|
|
12
12
|
const plugin_formula_1 = require("@objectql/plugin-formula");
|
|
13
13
|
const query_service_1 = require("./query/query-service");
|
|
14
14
|
const query_analyzer_1 = require("./query/query-analyzer");
|
|
15
|
+
const protocol_1 = require("./protocol");
|
|
15
16
|
/**
|
|
16
17
|
* ObjectQL Plugin
|
|
17
18
|
*
|
|
@@ -102,6 +103,13 @@ class ObjectQLPlugin {
|
|
|
102
103
|
engine: kernel,
|
|
103
104
|
getKernel: () => kernel
|
|
104
105
|
};
|
|
106
|
+
// Register Protocol Service
|
|
107
|
+
// If kernel supports service registration (PluginContext or ExtendedKernel with custom registry)
|
|
108
|
+
if (kernel && typeof kernel.registerService === 'function') {
|
|
109
|
+
console.log(`[${this.name}] Registering protocol service...`);
|
|
110
|
+
const protocolShim = new protocol_1.ObjectStackProtocolImplementation(kernel);
|
|
111
|
+
kernel.registerService('protocol', protocolShim);
|
|
112
|
+
}
|
|
105
113
|
return this.install(ctx);
|
|
106
114
|
}
|
|
107
115
|
async start(kernel) {
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,iEAAoF;AACpF,6DAA8E;AAC9E,yDAAqD;AACrD,2DAAuD;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,iEAAoF;AACpF,6DAA8E;AAC9E,yDAAqD;AACrD,2DAAuD;AACvD,yCAA+D;AAyE/D;;;;;GAKG;AACH,MAAa,cAAc;IAIzB,YAAoB,SAA+B,EAAE,EAAE,EAAQ;QAA3C,WAAM,GAAN,MAAM,CAA2B;QAHrD,SAAI,GAAG,gBAAgB,CAAC;QACxB,YAAO,GAAG,OAAO,CAAC;QAGhB,eAAe;QACf,IAAI,CAAC,MAAM,GAAG;YACZ,gBAAgB,EAAE,IAAI;YACtB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE,IAAI;YACd,kBAAkB,EAAE,IAAI;YACxB,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,GAAmB;;QAC/B,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,wBAAwB,CAAC,CAAC;QAEnD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAwB,CAAC;QAE5C,8DAA8D;QAC9D,IAAI,WAAW,GAA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,EAAE,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,MAAM,CAAC,KAAK,GAAG,KAAK,EAAE,UAAkB,EAAE,OAAa,EAAmB,EAAE;YAC1E,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YACrC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,iCAAiC,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,UAAU,CAAC,MAAW;QAClC,kCAAkC;QAClC,4DAA4D;QAC5D,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,6BAA6B,CAAC,CAAC;IAC1D,CAAC;CACF;AAxLD,wCAwLC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectStack Protocol Implementation
|
|
3
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
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.
|
|
7
|
+
*/
|
|
8
|
+
import { ObjectStackProtocol } from '@objectstack/spec/api';
|
|
9
|
+
import { IObjectQL } from '@objectql/types';
|
|
10
|
+
/**
|
|
11
|
+
* Bridges the ObjectStack Protocol (Specification) to the ObjectQL Engine (Implementation)
|
|
12
|
+
*/
|
|
13
|
+
export declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
|
|
14
|
+
private engine;
|
|
15
|
+
constructor(engine: IObjectQL);
|
|
16
|
+
/**
|
|
17
|
+
* Get API Discovery Document
|
|
18
|
+
*/
|
|
19
|
+
getDiscovery(args: any): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Get Metadata Types (e.g., ['object', 'action'])
|
|
22
|
+
*/
|
|
23
|
+
getMetaTypes(args: any): Promise<{
|
|
24
|
+
types: string[];
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Get Metadata Items for a Type
|
|
28
|
+
*/
|
|
29
|
+
getMetaItems(args: {
|
|
30
|
+
type: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
type: string;
|
|
33
|
+
items: any[];
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Get Metadata Item
|
|
37
|
+
*/
|
|
38
|
+
getMetaItem(args: {
|
|
39
|
+
type: string;
|
|
40
|
+
name: string;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Get Cached Metadata Item
|
|
44
|
+
*/
|
|
45
|
+
getMetaItemCached(args: {
|
|
46
|
+
type: string;
|
|
47
|
+
name: string;
|
|
48
|
+
}): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Get UI View
|
|
51
|
+
*/
|
|
52
|
+
getUiView(args: {
|
|
53
|
+
object: string;
|
|
54
|
+
type: 'list' | 'form';
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
/**
|
|
57
|
+
* Find Data Records
|
|
58
|
+
*/
|
|
59
|
+
findData(args: {
|
|
60
|
+
object: string;
|
|
61
|
+
query?: any;
|
|
62
|
+
}): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Count Data Records
|
|
65
|
+
*/
|
|
66
|
+
countData(args: {
|
|
67
|
+
object: string;
|
|
68
|
+
query?: any;
|
|
69
|
+
}): Promise<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Get Single Data Record
|
|
72
|
+
*/
|
|
73
|
+
getData(args: {
|
|
74
|
+
object: string;
|
|
75
|
+
id: string;
|
|
76
|
+
}): Promise<any>;
|
|
77
|
+
/**
|
|
78
|
+
* Create Data Record
|
|
79
|
+
*/
|
|
80
|
+
createData(args: {
|
|
81
|
+
object: string;
|
|
82
|
+
data: any;
|
|
83
|
+
}): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* Update Data Record
|
|
86
|
+
*/
|
|
87
|
+
updateData(args: {
|
|
88
|
+
object: string;
|
|
89
|
+
id: string;
|
|
90
|
+
data: any;
|
|
91
|
+
}): Promise<any>;
|
|
92
|
+
/**
|
|
93
|
+
* Delete Data Record
|
|
94
|
+
*/
|
|
95
|
+
deleteData(args: {
|
|
96
|
+
object: string;
|
|
97
|
+
id: string;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
object: string;
|
|
100
|
+
id: string;
|
|
101
|
+
success: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
/**
|
|
104
|
+
* Create Many Data Records
|
|
105
|
+
*/
|
|
106
|
+
createManyData(args: {
|
|
107
|
+
object: string;
|
|
108
|
+
records: any[];
|
|
109
|
+
options?: any;
|
|
110
|
+
}): Promise<any>;
|
|
111
|
+
/**
|
|
112
|
+
* Update Many Data Records
|
|
113
|
+
*/
|
|
114
|
+
updateManyData(args: {
|
|
115
|
+
object: string;
|
|
116
|
+
records: {
|
|
117
|
+
id: string;
|
|
118
|
+
data: any;
|
|
119
|
+
}[];
|
|
120
|
+
options?: any;
|
|
121
|
+
}): Promise<any>;
|
|
122
|
+
/**
|
|
123
|
+
* Delete Many Data Records
|
|
124
|
+
*/
|
|
125
|
+
deleteManyData(args: {
|
|
126
|
+
object: string;
|
|
127
|
+
ids: string[];
|
|
128
|
+
options?: any;
|
|
129
|
+
}): Promise<any>;
|
|
130
|
+
/**
|
|
131
|
+
* Batch Operations
|
|
132
|
+
*/
|
|
133
|
+
batchData(args: {
|
|
134
|
+
object: string;
|
|
135
|
+
request: {
|
|
136
|
+
operation: 'create' | 'update' | 'delete' | 'upsert';
|
|
137
|
+
records: any[];
|
|
138
|
+
};
|
|
139
|
+
}): Promise<any>;
|
|
140
|
+
/**
|
|
141
|
+
* Execute Action/Operation
|
|
142
|
+
*/
|
|
143
|
+
performAction(args: {
|
|
144
|
+
object: string;
|
|
145
|
+
id?: string;
|
|
146
|
+
action: string;
|
|
147
|
+
args?: any;
|
|
148
|
+
}): Promise<any>;
|
|
149
|
+
}
|
package/dist/protocol.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ObjectStack Protocol Implementation
|
|
4
|
+
* Copyright (c) 2026-present ObjectStack Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ObjectStackProtocolImplementation = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Bridges the ObjectStack Protocol (Specification) to the ObjectQL Engine (Implementation)
|
|
13
|
+
*/
|
|
14
|
+
class ObjectStackProtocolImplementation {
|
|
15
|
+
constructor(engine) {
|
|
16
|
+
this.engine = engine;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get API Discovery Document
|
|
20
|
+
*/
|
|
21
|
+
async getDiscovery(args) {
|
|
22
|
+
return {
|
|
23
|
+
name: 'ObjectQL Engine',
|
|
24
|
+
version: '4.0.0',
|
|
25
|
+
protocols: ['rest', 'graphql', 'json-rpc', 'odata'],
|
|
26
|
+
auth: {
|
|
27
|
+
type: 'bearer',
|
|
28
|
+
url: '/auth/token'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get Metadata Types (e.g., ['object', 'action'])
|
|
34
|
+
*/
|
|
35
|
+
async getMetaTypes(args) {
|
|
36
|
+
let types = ['object'];
|
|
37
|
+
if (this.engine.metadata && typeof this.engine.metadata.getTypes === 'function') {
|
|
38
|
+
types = this.engine.metadata.getTypes();
|
|
39
|
+
}
|
|
40
|
+
return { types };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get Metadata Items for a Type
|
|
44
|
+
*/
|
|
45
|
+
async getMetaItems(args) {
|
|
46
|
+
const { type } = args;
|
|
47
|
+
let items = [];
|
|
48
|
+
if (this.engine.metadata && typeof this.engine.metadata.list === 'function') {
|
|
49
|
+
items = this.engine.metadata.list(type);
|
|
50
|
+
}
|
|
51
|
+
return { type, items };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get Metadata Item
|
|
55
|
+
*/
|
|
56
|
+
async getMetaItem(args) {
|
|
57
|
+
const { type, name } = args;
|
|
58
|
+
if (this.engine.metadata && typeof this.engine.metadata.get === 'function') {
|
|
59
|
+
return this.engine.metadata.get(type, name);
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get Cached Metadata Item
|
|
65
|
+
*/
|
|
66
|
+
async getMetaItemCached(args) {
|
|
67
|
+
// Fallback to non-cached version for now
|
|
68
|
+
return this.getMetaItem(args);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get UI View
|
|
72
|
+
*/
|
|
73
|
+
async getUiView(args) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Find Data Records
|
|
78
|
+
*/
|
|
79
|
+
async findData(args) {
|
|
80
|
+
const { object, query } = args;
|
|
81
|
+
// Use direct kernel method if available (preferred)
|
|
82
|
+
if (typeof this.engine.find === 'function') {
|
|
83
|
+
const result = await this.engine.find(object, query || {});
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
// Fallback to createContext (if engine is IObjectQL)
|
|
87
|
+
if (typeof this.engine.createContext === 'function') {
|
|
88
|
+
const ctx = this.engine.createContext({ isSystem: true });
|
|
89
|
+
try {
|
|
90
|
+
const repo = ctx.object(object);
|
|
91
|
+
return await repo.find(query || {});
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw new Error(`Data access failed: ${error.message}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
throw new Error('Engine does not support find operation');
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Count Data Records
|
|
101
|
+
*/
|
|
102
|
+
async countData(args) {
|
|
103
|
+
const { object, query } = args;
|
|
104
|
+
// Basic fallback
|
|
105
|
+
const result = await this.findData(args);
|
|
106
|
+
return Array.isArray(result) ? result.length : (result.value ? result.value.length : 0);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get Single Data Record
|
|
110
|
+
*/
|
|
111
|
+
async getData(args) {
|
|
112
|
+
const { object, id } = args;
|
|
113
|
+
if (typeof this.engine.get === 'function') {
|
|
114
|
+
return await this.engine.get(object, id);
|
|
115
|
+
}
|
|
116
|
+
if (typeof this.engine.createContext === 'function') {
|
|
117
|
+
const ctx = this.engine.createContext({ isSystem: true });
|
|
118
|
+
try {
|
|
119
|
+
const repo = ctx.object(object);
|
|
120
|
+
return await repo.findOne(id);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw new Error(`Data retrieval failed: ${error.message}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
throw new Error('Engine does not support get operation');
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Create Data Record
|
|
130
|
+
*/
|
|
131
|
+
async createData(args) {
|
|
132
|
+
const { object, data } = args;
|
|
133
|
+
if (typeof this.engine.create === 'function') {
|
|
134
|
+
return await this.engine.create(object, data);
|
|
135
|
+
}
|
|
136
|
+
if (typeof this.engine.createContext === 'function') {
|
|
137
|
+
const ctx = this.engine.createContext({ isSystem: true });
|
|
138
|
+
try {
|
|
139
|
+
const repo = ctx.object(object);
|
|
140
|
+
// Protocol expects returned data
|
|
141
|
+
return await repo.create(data);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
throw new Error(`Data creation failed: ${error.message}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
throw new Error('Engine does not support create operation');
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Update Data Record
|
|
151
|
+
*/
|
|
152
|
+
async updateData(args) {
|
|
153
|
+
const { object, id, data } = args;
|
|
154
|
+
if (typeof this.engine.update === 'function') {
|
|
155
|
+
return await this.engine.update(object, id, data);
|
|
156
|
+
}
|
|
157
|
+
if (typeof this.engine.createContext === 'function') {
|
|
158
|
+
const ctx = this.engine.createContext({ isSystem: true });
|
|
159
|
+
try {
|
|
160
|
+
const repo = ctx.object(object);
|
|
161
|
+
return await repo.update(id, data);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
throw new Error(`Data update failed: ${error.message}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
throw new Error('Engine does not support update operation');
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Delete Data Record
|
|
171
|
+
*/
|
|
172
|
+
async deleteData(args) {
|
|
173
|
+
const { object, id } = args;
|
|
174
|
+
if (typeof this.engine.delete === 'function') {
|
|
175
|
+
const success = await this.engine.delete(object, id);
|
|
176
|
+
return { object, id, success: !!success };
|
|
177
|
+
}
|
|
178
|
+
if (typeof this.engine.createContext === 'function') {
|
|
179
|
+
const ctx = this.engine.createContext({ isSystem: true });
|
|
180
|
+
try {
|
|
181
|
+
const repo = ctx.object(object);
|
|
182
|
+
await repo.delete(id);
|
|
183
|
+
return { object, id, success: true };
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
throw new Error(`Data deletion failed: ${error.message}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
throw new Error('Engine does not support delete operation');
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Create Many Data Records
|
|
193
|
+
*/
|
|
194
|
+
async createManyData(args) {
|
|
195
|
+
throw new Error('createManyData not implemented');
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Update Many Data Records
|
|
199
|
+
*/
|
|
200
|
+
async updateManyData(args) {
|
|
201
|
+
throw new Error('updateManyData not implemented');
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Delete Many Data Records
|
|
205
|
+
*/
|
|
206
|
+
async deleteManyData(args) {
|
|
207
|
+
throw new Error('deleteManyData not implemented');
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Batch Operations
|
|
211
|
+
*/
|
|
212
|
+
async batchData(args) {
|
|
213
|
+
throw new Error('batchData not implemented');
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Execute Action/Operation
|
|
217
|
+
*/
|
|
218
|
+
async performAction(args) {
|
|
219
|
+
// Not implemented in this shim yet
|
|
220
|
+
throw new Error('Action execution not implemented in protocol shim');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
exports.ObjectStackProtocolImplementation = ObjectStackProtocolImplementation;
|
|
224
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAKH;;GAEG;AACH,MAAa,iCAAiC;IAC1C,YAAoB,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAEzC;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,IAAS;QACxB,OAAO;YACH,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC;YACnD,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,GAAG,EAAE,aAAa;aACrB;SACJ,CAAC;IACN,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,IAAS;QACxB,IAAI,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC9E,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,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D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,IAA2G;QACvH,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,IAAiE;QACjF,mCAAmC;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACzE,CAAC;CACJ;AA1OD,8EA0OC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@objectql/core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "Universal runtime engine for ObjectQL - AI-native metadata-driven ORM with validation, repository pattern, and driver orchestration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"objectql",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"main": "dist/index.js",
|
|
19
19
|
"types": "dist/index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@objectstack/
|
|
22
|
-
"@objectstack/
|
|
23
|
-
"@objectstack/
|
|
24
|
-
"@objectstack/
|
|
21
|
+
"@objectstack/core": "^0.8.2",
|
|
22
|
+
"@objectstack/objectql": "^0.8.2",
|
|
23
|
+
"@objectstack/runtime": "^0.8.2",
|
|
24
|
+
"@objectstack/spec": "^0.8.2",
|
|
25
25
|
"js-yaml": "^4.1.0",
|
|
26
|
-
"@objectql/
|
|
27
|
-
"@objectql/plugin-
|
|
28
|
-
"@objectql/
|
|
26
|
+
"@objectql/plugin-formula": "4.0.5",
|
|
27
|
+
"@objectql/plugin-validator": "4.0.5",
|
|
28
|
+
"@objectql/types": "4.0.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/js-yaml": "^4.0.5",
|
package/src/plugin.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { ValidatorPlugin, ValidatorPluginConfig } from '@objectql/plugin-validat
|
|
|
11
11
|
import { FormulaPlugin, FormulaPluginConfig } from '@objectql/plugin-formula';
|
|
12
12
|
import { QueryService } from './query/query-service';
|
|
13
13
|
import { QueryAnalyzer } from './query/query-analyzer';
|
|
14
|
+
import { ObjectStackProtocolImplementation } from './protocol';
|
|
14
15
|
import type { Driver } from '@objectql/types';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -190,6 +191,15 @@ export class ObjectQLPlugin implements RuntimePlugin {
|
|
|
190
191
|
engine: kernel,
|
|
191
192
|
getKernel: () => kernel
|
|
192
193
|
};
|
|
194
|
+
|
|
195
|
+
// Register Protocol Service
|
|
196
|
+
// If kernel supports service registration (PluginContext or ExtendedKernel with custom registry)
|
|
197
|
+
if (kernel && typeof kernel.registerService === 'function') {
|
|
198
|
+
console.log(`[${this.name}] Registering protocol service...`);
|
|
199
|
+
const protocolShim = new ObjectStackProtocolImplementation(kernel as any);
|
|
200
|
+
kernel.registerService('protocol', protocolShim);
|
|
201
|
+
}
|
|
202
|
+
|
|
193
203
|
return this.install(ctx);
|
|
194
204
|
}
|
|
195
205
|
|