@objectstack/runtime 1.0.6 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/runtime",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "license": "Apache-2.0",
5
5
  "description": "ObjectStack Core Runtime & Query Engine",
6
6
  "type": "module",
@@ -8,9 +8,9 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "dependencies": {
10
10
  "zod": "^3.24.1",
11
- "@objectstack/core": "1.0.6",
12
- "@objectstack/spec": "1.0.6",
13
- "@objectstack/types": "1.0.6"
11
+ "@objectstack/core": "1.0.7",
12
+ "@objectstack/spec": "1.0.7",
13
+ "@objectstack/types": "1.0.7"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.0.0",
package/src/app-plugin.ts CHANGED
@@ -11,6 +11,7 @@ import { Plugin, PluginContext } from '@objectstack/core';
11
11
  */
12
12
  export class AppPlugin implements Plugin {
13
13
  name: string;
14
+ type = 'app';
14
15
  version?: string;
15
16
 
16
17
  private bundle: any;
@@ -16,6 +16,7 @@ import { Plugin, PluginContext } from '@objectstack/core';
16
16
  */
17
17
  export class DriverPlugin implements Plugin {
18
18
  name: string;
19
+ type = 'driver';
19
20
  version = '1.0.0';
20
21
  // dependencies = ['com.objectstack.engine.objectql']; // Removed: Driver is a producer, not strictly a consumer during init
21
22
 
@@ -213,6 +213,26 @@ export class RestServer {
213
213
  handler: async (_req: any, res: any) => {
214
214
  try {
215
215
  const discovery = await this.protocol.getDiscovery({});
216
+
217
+ // Override discovery information with actual server configuration
218
+ discovery.version = this.config.api.version;
219
+
220
+ if (discovery.endpoints) {
221
+ // Ensure endpoints match the actual mounted paths
222
+ if (this.config.api.enableCrud) {
223
+ discovery.endpoints.data = `${basePath}${this.config.crud.dataPrefix}`;
224
+ }
225
+
226
+ if (this.config.api.enableMetadata) {
227
+ discovery.endpoints.metadata = `${basePath}${this.config.metadata.prefix}`;
228
+ }
229
+
230
+ // Align auth endpoint with the versioned base path if present
231
+ if (discovery.endpoints.auth) {
232
+ discovery.endpoints.auth = `${basePath}/auth`;
233
+ }
234
+ }
235
+
216
236
  res.json(discovery);
217
237
  } catch (error: any) {
218
238
  res.status(500).json({ error: error.message });