@objectql/platform-node 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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  export * from './runtime';
7
7
 
8
- export const createLogger = (options: any) => ({
8
+ export const createLogger = (_options: any) => ({
9
9
  info: console.log,
10
10
  warn: console.warn,
11
11
  error: console.error,
@@ -48,8 +48,8 @@ export class SchemaRegistry {
48
48
  SchemaRegistry.metadata.clear();
49
49
  }
50
50
 
51
- register(schema: any): void {}
52
- get(name: string): any { return null; }
51
+ register(_schema: any): void {}
52
+ get(_name: string): any { return null; }
53
53
  list(): any[] { return []; }
54
54
  }
55
55
 
@@ -11,12 +11,21 @@
11
11
  class MockMetadataRegistry {
12
12
  private store = new Map<string, Map<string, any>>();
13
13
 
14
- register(type: string, item: any): void {
14
+ register(type: string, nameOrConfig: string | any, config?: any): void {
15
15
  if (!this.store.has(type)) {
16
16
  this.store.set(type, new Map());
17
17
  }
18
18
  const typeMap = this.store.get(type)!;
19
- typeMap.set(item.id || item.name, item);
19
+ let name: string;
20
+ let item: any;
21
+ if (config) {
22
+ name = nameOrConfig as string;
23
+ item = config;
24
+ } else {
25
+ item = nameOrConfig;
26
+ name = item.id || item.name;
27
+ }
28
+ typeMap.set(name, item);
20
29
  }
21
30
 
22
31
  get<T = any>(type: string, id: string): T | undefined {
@@ -48,7 +57,7 @@ class MockMetadataRegistry {
48
57
 
49
58
  unregisterPackage(packageName: string): void {
50
59
  // Simple implementation - in real runtime this would filter by package
51
- for (const [type, typeMap] of this.store.entries()) {
60
+ for (const [_type, typeMap] of this.store.entries()) {
52
61
  const toDelete: string[] = [];
53
62
  for (const [id, item] of typeMap.entries()) {
54
63
  if (item.packageName === packageName || item.package === packageName) {
@@ -61,7 +70,7 @@ class MockMetadataRegistry {
61
70
  }
62
71
 
63
72
  class MockHookManager {
64
- removePackage(packageName: string): void {
73
+ removePackage(_packageName: string): void {
65
74
  // Mock implementation
66
75
  }
67
76
 
@@ -71,7 +80,7 @@ class MockHookManager {
71
80
  }
72
81
 
73
82
  class MockActionManager {
74
- removePackage(packageName: string): void {
83
+ removePackage(_packageName: string): void {
75
84
  // Mock implementation
76
85
  }
77
86
 
@@ -189,11 +198,11 @@ export class ObjectKernel {
189
198
  return true;
190
199
  }
191
200
 
192
- getMetadata(objectName: string): any {
201
+ getMetadata(_objectName: string): any {
193
202
  return {};
194
203
  }
195
204
 
196
- getView(objectName: string, viewType?: 'list' | 'form'): any {
205
+ getView(_objectName: string, _viewType?: 'list' | 'form'): any {
197
206
  return null;
198
207
  }
199
208
  }
package/tsconfig.json CHANGED
@@ -7,8 +7,6 @@
7
7
  "include": ["src/**/*"],
8
8
  "references": [
9
9
  { "path": "../types" },
10
- { "path": "../core" },
11
- { "path": "../../drivers/sql" },
12
- { "path": "../../drivers/mongo" }
10
+ { "path": "../core" }
13
11
  ]
14
12
  }