@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/dist/auth.cjs +97 -0
- package/dist/collector-manager.cjs +437 -0
- package/dist/collector-manager.d.ts.map +1 -1
- package/dist/collector-manager.js +6 -4
- package/dist/collector-manager.js.map +1 -1
- package/dist/decorators.cjs +181 -0
- package/dist/dependency.cjs +165 -0
- package/dist/dev.cjs +34 -0
- package/dist/discovery.cjs +79 -0
- package/dist/docs.cjs +206 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +2 -2
- package/dist/docs.js.map +1 -1
- package/dist/env.cjs +125 -0
- package/dist/errors.cjs +58 -0
- package/dist/federation.cjs +356 -0
- package/dist/index.cjs +49 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory.cjs +361 -0
- package/dist/logger.cjs +482 -0
- package/dist/message.cjs +19 -0
- package/dist/requester.cjs +100 -0
- package/dist/routing.cjs +39 -0
- package/dist/runtime.cjs +760 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +3 -2
- package/dist/runtime.js.map +1 -1
- package/dist/services.cjs +346 -0
- package/dist/storage.cjs +147 -0
- package/dist/types.cjs +2 -0
- package/dist/utils/urls.cjs +55 -0
- package/dist/websocket.cjs +142 -0
- package/package.json +1 -1
- package/src/collector-manager.ts +6 -4
- package/src/docs.ts +2 -2
- package/src/index.ts +3 -0
- package/src/runtime.ts +3 -0
package/package.json
CHANGED
package/src/collector-manager.ts
CHANGED
|
@@ -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
|
|
215
|
-
|
|
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
|
-
|
|
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
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
|
|