@omen.foundation/node-microservice-runtime 0.1.35 → 0.1.37

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": "@omen.foundation/node-microservice-runtime",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Beamable microservice runtime for Node.js/TypeScript services.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -211,11 +211,13 @@ async function downloadAndDecompressGzip(url: string, outputPath: string, makeEx
211
211
  }
212
212
  } catch (error) {
213
213
  // Re-throw with more context
214
- if (error instanceof Error && error.message.includes('Timeout') || error.message.includes('DNS') || error.message.includes('Connection')) {
215
- throw error; // Already has good context
214
+ if (error instanceof Error) {
215
+ if (error.message.includes('Timeout') || error.message.includes('DNS') || error.message.includes('Connection')) {
216
+ throw error; // Already has good context
217
+ }
218
+ throw new Error(`Network error downloading ${url}: ${error.message}`);
216
219
  }
217
- const errorMsg = error instanceof Error ? error.message : String(error);
218
- throw new Error(`Network error downloading ${url}: ${errorMsg}`);
220
+ throw new Error(`Network error downloading ${url}: ${String(error)}`);
219
221
  }
220
222
 
221
223
  if (!response.ok) {
package/src/docs.ts CHANGED
@@ -52,14 +52,14 @@ interface OpenApiDocument {
52
52
  };
53
53
  }
54
54
 
55
- export function generateOpenApiDocument(service: ServiceDescriptorLite, env: EnvironmentConfig): OpenApiDocument {
55
+ export function generateOpenApiDocument(service: ServiceDescriptorLite, env: EnvironmentConfig, runtimeVersion?: string): OpenApiDocument {
56
56
  const serverBase = buildServiceBaseUrl(env, service);
57
57
 
58
58
  const doc: OpenApiDocument = {
59
59
  openapi: '3.0.1',
60
60
  info: {
61
61
  title: service.name,
62
- version: '0.0.0',
62
+ version: runtimeVersion || process.env.BEAMABLE_RUNTIME_VERSION || '0.0.0',
63
63
  },
64
64
  servers: serverBase ? [{ url: serverBase }] : [],
65
65
  paths: {},
package/src/index.ts CHANGED
@@ -57,3 +57,6 @@ export {
57
57
  getCollectorProcessStatus,
58
58
  type CollectorStatus,
59
59
  } from './collector-manager.js';
60
+
61
+ // Export runtime version
62
+ export const VERSION = '0.1.36';
package/src/runtime.ts CHANGED
@@ -6,6 +6,7 @@ import { createLogger } from './logger.js';
6
6
  import { loadEnvironmentConfig } from './env.js';
7
7
  import { listRegisteredServices, getServiceOptions, getConfigureServicesHandlers, getInitializeServicesHandlers } from './decorators.js';
8
8
  import { generateOpenApiDocument } from './docs.js';
9
+ import { VERSION } from './index.js';
9
10
  import { DiscoveryBroadcaster } from './discovery.js';
10
11
  import { BeamableRuntimeError, MissingScopesError, UnauthorizedUserError, UnknownRouteError } from './errors.js';
11
12
  import type {
@@ -677,6 +678,7 @@ export class MicroserviceRuntime {
677
678
  })),
678
679
  },
679
680
  this.env,
681
+ VERSION,
680
682
  );
681
683
 
682
684
  // Ensure document is valid (not empty)
@@ -979,6 +981,7 @@ export function generateOpenApiDocumentForRegisteredServices(
979
981
  })),
980
982
  },
981
983
  baseEnv,
984
+ VERSION,
982
985
  );
983
986
  }
984
987