Skip to content

Commit 210534a

Browse files
authored
Merge pull request #587 from objectstack-ai/copilot/fix-ci-build-test
2 parents 0df9583 + 3ae1ca0 commit 210534a

3 files changed

Lines changed: 615 additions & 9 deletions

File tree

packages/objectql/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class ObjectQLPlugin implements Plugin {
115115

116116
ctx.logger.info('ObjectQL engine started', {
117117
driversRegistered: this.ql?.['drivers']?.size || 0,
118-
objectsRegistered: this.ql?.registry?.listObjects?.()?.length || 0
118+
objectsRegistered: this.ql?.registry?.getAllObjects?.()?.length || 0
119119
});
120120
}
121121

packages/objectql/src/protocol.ts

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
UpdateManyDataRequest,
99
DeleteManyDataRequest
1010
} from '@objectstack/spec/api';
11-
import type { MetadataCacheRequest, MetadataCacheResponse, ServiceInfo } from '@objectstack/spec/api';
11+
import type { MetadataCacheRequest, MetadataCacheResponse, ServiceInfo, ApiRoutes } from '@objectstack/spec/api';
1212

1313
// We import SchemaRegistry directly since this class lives in the same package
1414
import { SchemaRegistry } from './registry.js';
@@ -103,21 +103,40 @@ export class ObjectStackProtocolImplementation implements ObjectStackProtocol {
103103
};
104104

105105
// Build endpoints (only include available services)
106-
const endpoints: Record<string, string> = {
107-
data: '/api/data',
108-
metadata: '/api/meta',
106+
// Map service names to ApiRoutes keys
107+
const serviceToEndpointKey: Record<string, keyof ApiRoutes> = {
108+
auth: 'auth',
109+
automation: 'automation',
110+
ui: 'ui',
111+
workflow: 'workflow',
112+
realtime: 'realtime',
113+
notification: 'notifications',
114+
ai: 'ai',
115+
i18n: 'i18n',
116+
graphql: 'graphql',
117+
'file-storage': 'storage',
118+
};
119+
120+
const optionalEndpoints: Partial<ApiRoutes> = {
109121
analytics: '/api/analytics',
110122
};
111123

112124
// Add routes for available plugin services
113125
for (const [serviceName, config] of Object.entries(SERVICE_CONFIG)) {
114126
if (registeredServices.has(serviceName)) {
115-
// Map service name to endpoint key (some services use different names)
116-
const endpointKey = serviceName === 'file-storage' ? 'storage' : serviceName;
117-
endpoints[endpointKey] = config.route;
127+
const endpointKey = serviceToEndpointKey[serviceName];
128+
if (endpointKey) {
129+
optionalEndpoints[endpointKey] = config.route;
130+
}
118131
}
119132
}
120133

134+
const endpoints: ApiRoutes = {
135+
data: '/api/data',
136+
metadata: '/api/meta',
137+
...optionalEndpoints,
138+
};
139+
121140
return {
122141
version: '1.0',
123142
apiName: 'ObjectStack API',

0 commit comments

Comments
 (0)