imean-service-engine 1.7.0 → 1.7.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.
- package/dist/mod.cjs +21 -15
- package/dist/mod.d.cts +6 -1
- package/dist/mod.d.ts +6 -1
- package/dist/mod.js +21 -15
- package/package.json +86 -87
package/dist/mod.cjs
CHANGED
@@ -1672,23 +1672,29 @@ var ServiceStatusPage_default = ServiceStatusPage;
|
|
1672
1672
|
|
1673
1673
|
// core/plugins/page/mod.ts
|
1674
1674
|
var PageRenderPlugin = class extends Plugin {
|
1675
|
+
constructor(options = {}) {
|
1676
|
+
super();
|
1677
|
+
this.options = options;
|
1678
|
+
}
|
1675
1679
|
initialize = async (engine) => {
|
1676
1680
|
const app = engine.getApp();
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1681
|
+
if (this.options.useDefaultStatusPage) {
|
1682
|
+
app.get(`${engine.options.prefix}`, async (ctx) => {
|
1683
|
+
return ctx.html(HtmxLayout({
|
1684
|
+
title: engine.options.name,
|
1685
|
+
children: ServiceStatusPage_default({
|
1686
|
+
serviceInfo: {
|
1687
|
+
name: engine.options.name,
|
1688
|
+
prefix: engine.options.prefix,
|
1689
|
+
version: engine.options.version,
|
1690
|
+
env: engine.options.env,
|
1691
|
+
id: engine.serviceId,
|
1692
|
+
modules: engine.getModules(false)
|
1693
|
+
}
|
1694
|
+
})
|
1695
|
+
}));
|
1696
|
+
});
|
1697
|
+
}
|
1692
1698
|
logger_default.info(`PageRenderPlugin enabled`);
|
1693
1699
|
};
|
1694
1700
|
};
|
package/dist/mod.d.cts
CHANGED
@@ -340,7 +340,12 @@ declare const ServiceStatusPage: ({ serviceInfo, }: {
|
|
340
340
|
serviceInfo: ServiceInfo;
|
341
341
|
}) => hono_jsx_jsx_dev_runtime.JSX.Element;
|
342
342
|
|
343
|
+
interface PageRenderPluginOptions {
|
344
|
+
useDefaultStatusPage?: boolean;
|
345
|
+
}
|
343
346
|
declare class PageRenderPlugin extends Plugin {
|
347
|
+
private readonly options;
|
348
|
+
constructor(options?: PageRenderPluginOptions);
|
344
349
|
initialize: (engine: Microservice) => Promise<void>;
|
345
350
|
}
|
346
351
|
|
@@ -375,4 +380,4 @@ declare function Schedule(options: ScheduleOptions): Function;
|
|
375
380
|
|
376
381
|
declare const logger: winston.Logger;
|
377
382
|
|
378
|
-
export { Action, type ActionErrorEvent, type ActionMetadata, type ActionOptions, BaseLayout, CacheAdapter, type CacheFn, type CleanupHook, type EtcdConfig, type EventServiceInfo, HtmxLayout, type McpOptions, MemoryCacheAdapter, Microservice, type MicroserviceOptions, ModelContextProtocolPlugin, Module, type ModuleInfo, type ModuleMetadata, type ModuleOptions, Page, type PageMetadata, type PageOptions, PageRenderPlugin, Plugin, type PreStartChecker, RedisCacheAdapter, type RequestInfo, Schedule, type ScheduleMetadata, ScheduleMode, type ScheduleOptions, ServiceContext, type ServiceInfo, ServiceInfoCards, type ServiceStats, ServiceStatusPage, type StatisticsEvent, type StreamResponse, logger, startCheck };
|
383
|
+
export { Action, type ActionErrorEvent, type ActionMetadata, type ActionOptions, BaseLayout, CacheAdapter, type CacheFn, type CleanupHook, type EtcdConfig, type EventServiceInfo, HtmxLayout, type McpOptions, MemoryCacheAdapter, Microservice, type MicroserviceOptions, ModelContextProtocolPlugin, Module, type ModuleInfo, type ModuleMetadata, type ModuleOptions, Page, type PageMetadata, type PageOptions, PageRenderPlugin, type PageRenderPluginOptions, Plugin, type PreStartChecker, RedisCacheAdapter, type RequestInfo, Schedule, type ScheduleMetadata, ScheduleMode, type ScheduleOptions, ServiceContext, type ServiceInfo, ServiceInfoCards, type ServiceStats, ServiceStatusPage, type StatisticsEvent, type StreamResponse, logger, startCheck };
|
package/dist/mod.d.ts
CHANGED
@@ -340,7 +340,12 @@ declare const ServiceStatusPage: ({ serviceInfo, }: {
|
|
340
340
|
serviceInfo: ServiceInfo;
|
341
341
|
}) => hono_jsx_jsx_dev_runtime.JSX.Element;
|
342
342
|
|
343
|
+
interface PageRenderPluginOptions {
|
344
|
+
useDefaultStatusPage?: boolean;
|
345
|
+
}
|
343
346
|
declare class PageRenderPlugin extends Plugin {
|
347
|
+
private readonly options;
|
348
|
+
constructor(options?: PageRenderPluginOptions);
|
344
349
|
initialize: (engine: Microservice) => Promise<void>;
|
345
350
|
}
|
346
351
|
|
@@ -375,4 +380,4 @@ declare function Schedule(options: ScheduleOptions): Function;
|
|
375
380
|
|
376
381
|
declare const logger: winston.Logger;
|
377
382
|
|
378
|
-
export { Action, type ActionErrorEvent, type ActionMetadata, type ActionOptions, BaseLayout, CacheAdapter, type CacheFn, type CleanupHook, type EtcdConfig, type EventServiceInfo, HtmxLayout, type McpOptions, MemoryCacheAdapter, Microservice, type MicroserviceOptions, ModelContextProtocolPlugin, Module, type ModuleInfo, type ModuleMetadata, type ModuleOptions, Page, type PageMetadata, type PageOptions, PageRenderPlugin, Plugin, type PreStartChecker, RedisCacheAdapter, type RequestInfo, Schedule, type ScheduleMetadata, ScheduleMode, type ScheduleOptions, ServiceContext, type ServiceInfo, ServiceInfoCards, type ServiceStats, ServiceStatusPage, type StatisticsEvent, type StreamResponse, logger, startCheck };
|
383
|
+
export { Action, type ActionErrorEvent, type ActionMetadata, type ActionOptions, BaseLayout, CacheAdapter, type CacheFn, type CleanupHook, type EtcdConfig, type EventServiceInfo, HtmxLayout, type McpOptions, MemoryCacheAdapter, Microservice, type MicroserviceOptions, ModelContextProtocolPlugin, Module, type ModuleInfo, type ModuleMetadata, type ModuleOptions, Page, type PageMetadata, type PageOptions, PageRenderPlugin, type PageRenderPluginOptions, Plugin, type PreStartChecker, RedisCacheAdapter, type RequestInfo, Schedule, type ScheduleMetadata, ScheduleMode, type ScheduleOptions, ServiceContext, type ServiceInfo, ServiceInfoCards, type ServiceStats, ServiceStatusPage, type StatisticsEvent, type StreamResponse, logger, startCheck };
|
package/dist/mod.js
CHANGED
@@ -1663,23 +1663,29 @@ var ServiceStatusPage_default = ServiceStatusPage;
|
|
1663
1663
|
|
1664
1664
|
// core/plugins/page/mod.ts
|
1665
1665
|
var PageRenderPlugin = class extends Plugin {
|
1666
|
+
constructor(options = {}) {
|
1667
|
+
super();
|
1668
|
+
this.options = options;
|
1669
|
+
}
|
1666
1670
|
initialize = async (engine) => {
|
1667
1671
|
const app = engine.getApp();
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1672
|
+
if (this.options.useDefaultStatusPage) {
|
1673
|
+
app.get(`${engine.options.prefix}`, async (ctx) => {
|
1674
|
+
return ctx.html(HtmxLayout({
|
1675
|
+
title: engine.options.name,
|
1676
|
+
children: ServiceStatusPage_default({
|
1677
|
+
serviceInfo: {
|
1678
|
+
name: engine.options.name,
|
1679
|
+
prefix: engine.options.prefix,
|
1680
|
+
version: engine.options.version,
|
1681
|
+
env: engine.options.env,
|
1682
|
+
id: engine.serviceId,
|
1683
|
+
modules: engine.getModules(false)
|
1684
|
+
}
|
1685
|
+
})
|
1686
|
+
}));
|
1687
|
+
});
|
1688
|
+
}
|
1683
1689
|
logger_default.info(`PageRenderPlugin enabled`);
|
1684
1690
|
};
|
1685
1691
|
};
|
package/package.json
CHANGED
@@ -1,87 +1,86 @@
|
|
1
|
-
{
|
2
|
-
"name": "imean-service-engine",
|
3
|
-
"version": "1.7.
|
4
|
-
"description": "microservice engine",
|
5
|
-
"keywords": [
|
6
|
-
"microservice",
|
7
|
-
"websocket",
|
8
|
-
"http",
|
9
|
-
"node"
|
10
|
-
],
|
11
|
-
"author": "imean",
|
12
|
-
"type": "module",
|
13
|
-
"license": "MIT",
|
14
|
-
"repository": {
|
15
|
-
"type": "git",
|
16
|
-
"url": "git+https://git.imean.tech/imean/imean-microservice-framework.git"
|
17
|
-
},
|
18
|
-
"main": "dist/mod.js",
|
19
|
-
"module": "dist/mod.js",
|
20
|
-
"types": "dist/mod.d.ts",
|
21
|
-
"exports": {
|
22
|
-
".": {
|
23
|
-
"types": "./dist/mod.d.ts",
|
24
|
-
"import": "./dist/mod.js",
|
25
|
-
"require": "./dist/mod.cjs"
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"files": [
|
29
|
-
"dist",
|
30
|
-
"README.md",
|
31
|
-
"LICENSE"
|
32
|
-
],
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
|
39
|
-
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
|
48
|
-
|
49
|
-
"
|
50
|
-
"
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
"@opentelemetry/
|
56
|
-
"
|
57
|
-
|
58
|
-
|
59
|
-
"@opentelemetry/
|
60
|
-
"@opentelemetry/
|
61
|
-
"@opentelemetry/
|
62
|
-
"@opentelemetry/
|
63
|
-
"@
|
64
|
-
"@
|
65
|
-
"@
|
66
|
-
"@
|
67
|
-
"@
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
|
78
|
-
|
79
|
-
"
|
80
|
-
|
81
|
-
|
82
|
-
"
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
}
|
1
|
+
{
|
2
|
+
"name": "imean-service-engine",
|
3
|
+
"version": "1.7.1",
|
4
|
+
"description": "microservice engine",
|
5
|
+
"keywords": [
|
6
|
+
"microservice",
|
7
|
+
"websocket",
|
8
|
+
"http",
|
9
|
+
"node"
|
10
|
+
],
|
11
|
+
"author": "imean",
|
12
|
+
"type": "module",
|
13
|
+
"license": "MIT",
|
14
|
+
"repository": {
|
15
|
+
"type": "git",
|
16
|
+
"url": "git+https://git.imean.tech/imean/imean-microservice-framework.git"
|
17
|
+
},
|
18
|
+
"main": "dist/mod.js",
|
19
|
+
"module": "dist/mod.js",
|
20
|
+
"types": "dist/mod.d.ts",
|
21
|
+
"exports": {
|
22
|
+
".": {
|
23
|
+
"types": "./dist/mod.d.ts",
|
24
|
+
"import": "./dist/mod.js",
|
25
|
+
"require": "./dist/mod.cjs"
|
26
|
+
}
|
27
|
+
},
|
28
|
+
"files": [
|
29
|
+
"dist",
|
30
|
+
"README.md",
|
31
|
+
"LICENSE"
|
32
|
+
],
|
33
|
+
"dependencies": {
|
34
|
+
"@hono/node-server": "^1.13.7",
|
35
|
+
"@hono/node-ws": "^1.0.6",
|
36
|
+
"@modelcontextprotocol/sdk": "^1.8.0",
|
37
|
+
"dayjs": "^1.11.13",
|
38
|
+
"ejson": "^2.2.3",
|
39
|
+
"etcd3": "^1.1.2",
|
40
|
+
"fs-extra": "^11.3.0",
|
41
|
+
"hono": "^4.6.17",
|
42
|
+
"lru-cache": "^11.0.2",
|
43
|
+
"prettier": "^3.4.2",
|
44
|
+
"ulid": "^3.0.0",
|
45
|
+
"winston": "^3.17.0",
|
46
|
+
"zod": "^3.24.1"
|
47
|
+
},
|
48
|
+
"peerDependencies": {
|
49
|
+
"@opentelemetry/api": "^1.x",
|
50
|
+
"ioredis": "^5.6.0"
|
51
|
+
},
|
52
|
+
"devDependencies": {
|
53
|
+
"@opentelemetry/auto-instrumentations-node": "^0.55.3",
|
54
|
+
"@opentelemetry/exporter-logs-otlp-proto": "^0.57.1",
|
55
|
+
"@opentelemetry/exporter-metrics-otlp-proto": "^0.57.1",
|
56
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.57.1",
|
57
|
+
"@opentelemetry/instrumentation-winston": "^0.44.0",
|
58
|
+
"@opentelemetry/sdk-logs": "^0.57.1",
|
59
|
+
"@opentelemetry/sdk-metrics": "^1.30.1",
|
60
|
+
"@opentelemetry/sdk-node": "^0.57.1",
|
61
|
+
"@opentelemetry/sdk-trace-node": "^1.30.1",
|
62
|
+
"@opentelemetry/winston-transport": "^0.10.0",
|
63
|
+
"@types/ejson": "^2.2.2",
|
64
|
+
"@types/fs-extra": "^11.0.4",
|
65
|
+
"@types/ioredis-mock": "^8.2.5",
|
66
|
+
"@types/node": "^20.0.0",
|
67
|
+
"@vitest/coverage-v8": "^3.0.4",
|
68
|
+
"imean-service-client": "^1.5.0",
|
69
|
+
"ioredis-mock": "^8.9.0",
|
70
|
+
"opentelemetry-instrumentation-fetch-node": "^1.2.3",
|
71
|
+
"tslib": "^2.8.1",
|
72
|
+
"tsup": "^8.0.1",
|
73
|
+
"tsx": "^4.19.2",
|
74
|
+
"typescript": "^5.3.3",
|
75
|
+
"vite-tsconfig-paths": "^5.1.4",
|
76
|
+
"vitest": "^3.0.3"
|
77
|
+
},
|
78
|
+
"engines": {
|
79
|
+
"node": ">=20"
|
80
|
+
},
|
81
|
+
"scripts": {
|
82
|
+
"dev": "tsx watch dev/index.ts",
|
83
|
+
"build": "tsup",
|
84
|
+
"test": "vitest run"
|
85
|
+
}
|
86
|
+
}
|