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 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
- app.get(`${engine.options.prefix}`, async (ctx) => {
1678
- return ctx.html(HtmxLayout({
1679
- title: engine.options.name,
1680
- children: ServiceStatusPage_default({
1681
- serviceInfo: {
1682
- name: engine.options.name,
1683
- prefix: engine.options.prefix,
1684
- version: engine.options.version,
1685
- env: engine.options.env,
1686
- id: engine.serviceId,
1687
- modules: engine.getModules(false)
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
- app.get(`${engine.options.prefix}`, async (ctx) => {
1669
- return ctx.html(HtmxLayout({
1670
- title: engine.options.name,
1671
- children: ServiceStatusPage_default({
1672
- serviceInfo: {
1673
- name: engine.options.name,
1674
- prefix: engine.options.prefix,
1675
- version: engine.options.version,
1676
- env: engine.options.env,
1677
- id: engine.serviceId,
1678
- modules: engine.getModules(false)
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.0",
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
- "scripts": {
34
- "dev": "tsx watch dev/index.ts",
35
- "build": "tsup",
36
- "test": "vitest run",
37
- "prepublishOnly": "npm run build && npm run test"
38
- },
39
- "dependencies": {
40
- "@hono/node-server": "^1.13.7",
41
- "@hono/node-ws": "^1.0.6",
42
- "@modelcontextprotocol/sdk": "^1.8.0",
43
- "dayjs": "^1.11.13",
44
- "ejson": "^2.2.3",
45
- "etcd3": "^1.1.2",
46
- "fs-extra": "^11.3.0",
47
- "hono": "^4.6.17",
48
- "lru-cache": "^11.0.2",
49
- "prettier": "^3.4.2",
50
- "ulid": "^3.0.0",
51
- "winston": "^3.17.0",
52
- "zod": "^3.24.1"
53
- },
54
- "peerDependencies": {
55
- "@opentelemetry/api": "^1.x",
56
- "ioredis": "^5.6.0"
57
- },
58
- "devDependencies": {
59
- "@opentelemetry/auto-instrumentations-node": "^0.55.3",
60
- "@opentelemetry/exporter-logs-otlp-proto": "^0.57.1",
61
- "@opentelemetry/exporter-metrics-otlp-proto": "^0.57.1",
62
- "@opentelemetry/exporter-trace-otlp-proto": "^0.57.1",
63
- "@opentelemetry/instrumentation-winston": "^0.44.0",
64
- "@opentelemetry/sdk-logs": "^0.57.1",
65
- "@opentelemetry/sdk-metrics": "^1.30.1",
66
- "@opentelemetry/sdk-node": "^0.57.1",
67
- "@opentelemetry/sdk-trace-node": "^1.30.1",
68
- "@opentelemetry/winston-transport": "^0.10.0",
69
- "@types/ejson": "^2.2.2",
70
- "@types/fs-extra": "^11.0.4",
71
- "@types/ioredis-mock": "^8.2.5",
72
- "@types/node": "^20.0.0",
73
- "@vitest/coverage-v8": "^3.0.4",
74
- "imean-service-client": "^1.5.0",
75
- "ioredis-mock": "^8.9.0",
76
- "opentelemetry-instrumentation-fetch-node": "^1.2.3",
77
- "tslib": "^2.8.1",
78
- "tsup": "^8.0.1",
79
- "tsx": "^4.19.2",
80
- "typescript": "^5.3.3",
81
- "vite-tsconfig-paths": "^5.1.4",
82
- "vitest": "^3.0.3"
83
- },
84
- "engines": {
85
- "node": ">=20"
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
+ }