apm-optima 1.0.2 → 1.0.4

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.
Files changed (49) hide show
  1. package/dashboard-out/404/index.html +1 -0
  2. package/dashboard-out/404.html +1 -0
  3. package/dashboard-out/__next.__PAGE__.txt +9 -0
  4. package/dashboard-out/__next._full.txt +26 -0
  5. package/dashboard-out/__next._head.txt +6 -0
  6. package/dashboard-out/__next._index.txt +11 -0
  7. package/dashboard-out/__next._tree.txt +4 -0
  8. package/dashboard-out/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  9. package/dashboard-out/_next/static/chunks/158myu8e_yme3.js +1 -0
  10. package/dashboard-out/_next/static/chunks/20t9qbodfrw_z.js +3 -0
  11. package/dashboard-out/_next/static/chunks/23soo6qkun-yv.js +1 -0
  12. package/dashboard-out/_next/static/chunks/2dkoocrktt9k-.js +5 -0
  13. package/dashboard-out/_next/static/chunks/2xjcsu4pgp14_.js +1 -0
  14. package/dashboard-out/_next/static/chunks/3l2cn98nr6ga3.js +31 -0
  15. package/dashboard-out/_next/static/chunks/3rxl-jt3pdxgx.js +1 -0
  16. package/dashboard-out/_next/static/chunks/3xoopocxi2vi8.css +3 -0
  17. package/dashboard-out/_next/static/chunks/turbopack-3pm0wlre028dz.js +1 -0
  18. package/dashboard-out/_next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
  19. package/dashboard-out/_next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
  20. package/dashboard-out/_next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
  21. package/dashboard-out/_next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
  22. package/dashboard-out/_next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
  23. package/dashboard-out/_next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
  24. package/dashboard-out/_next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
  25. package/dashboard-out/_next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
  26. package/dashboard-out/_next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
  27. package/dashboard-out/_next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
  28. package/dashboard-out/_next/static/media/favicon.2vob68tjqpejf.ico +0 -0
  29. package/dashboard-out/_next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
  30. package/dashboard-out/_next/static/u8vU2V6fhASeGVCpWU3eW/_buildManifest.js +16 -0
  31. package/dashboard-out/_next/static/u8vU2V6fhASeGVCpWU3eW/_clientMiddlewareManifest.js +1 -0
  32. package/dashboard-out/_next/static/u8vU2V6fhASeGVCpWU3eW/_ssgManifest.js +1 -0
  33. package/dashboard-out/_not-found/__next._full.txt +22 -0
  34. package/dashboard-out/_not-found/__next._head.txt +6 -0
  35. package/dashboard-out/_not-found/__next._index.txt +11 -0
  36. package/dashboard-out/_not-found/__next._not-found.__PAGE__.txt +5 -0
  37. package/dashboard-out/_not-found/__next._not-found.txt +5 -0
  38. package/dashboard-out/_not-found/__next._tree.txt +2 -0
  39. package/dashboard-out/_not-found/index.html +1 -0
  40. package/dashboard-out/_not-found/index.txt +22 -0
  41. package/dashboard-out/favicon.ico +0 -0
  42. package/dashboard-out/gear.svg +14 -0
  43. package/dashboard-out/index.html +1 -0
  44. package/dashboard-out/index.txt +26 -0
  45. package/dist/core/telemetry/logger.d.ts +1 -0
  46. package/dist/core/telemetry/logger.js +4 -0
  47. package/dist/express/metrics.dashboard.js +11 -4
  48. package/dist/nest/metrics.module.js +10 -3
  49. package/package.json +2 -1
@@ -0,0 +1,26 @@
1
+ 1:"$Sreact.fragment"
2
+ 2:I[98747,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"ThemeProvider"]
3
+ 3:I[52446,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"GateProvider"]
4
+ 4:I[11350,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"ConnectionProvider"]
5
+ 5:I[65327,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"MetricsProvider"]
6
+ 6:I[28874,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"default"]
7
+ 7:I[28407,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"default"]
8
+ 8:I[39756,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"default"]
9
+ 9:I[37457,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"default"]
10
+ a:I[47257,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"ClientPageRoot"]
11
+ b:I[42775,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js","./_next/static/chunks/23soo6qkun-yv.js"],"default"]
12
+ e:I[97367,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"OutletBoundary"]
13
+ f:"$Sreact.suspense"
14
+ 11:I[97367,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"ViewportBoundary"]
15
+ 13:I[97367,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"MetadataBoundary"]
16
+ 15:I[68027,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"default",1]
17
+ :HL["./_next/static/chunks/3xoopocxi2vi8.css","style"]
18
+ :HL["./_next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
19
+ :HL["./_next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
20
+ 0:{"P":null,"c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",16],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"./_next/static/chunks/3xoopocxi2vi8.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"./_next/static/chunks/2xjcsu4pgp14_.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"./_next/static/chunks/158myu8e_yme3.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"./_next/static/chunks/20t9qbodfrw_z.js","async":true,"nonce":"$undefined"}]],["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":["$","$L5",null,{"children":["$","div",null,{"className":"flex flex-col w-full h-screen overflow-hidden","children":[["$","$L6",null,{}],["$","div",null,{"className":"flex flex-row w-full h-full overflow-hidden","children":[["$","$L7",null,{}],["$","div",null,{"className":"flex flex-col w-full h-full overflow-auto","children":[["$","$L8",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L9",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}],["$","div",null,{"className":"flex items-center justify-between h-10 p-3","children":[["$","p",null,{"className":"text-sm text-[var(--variant-6)]","children":"optima-agent v1.0.0"}],["$","p",null,{"className":"text-sm text-[var(--variant-6)]","children":"telemetry healthy"}]]}]]}]]}]]}]}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$La",null,{"Component":"$b","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@c","$@d"]}}],[["$","script","script-0",{"src":"./_next/static/chunks/23soo6qkun-yv.js","async":true,"nonce":"$undefined"}]],["$","$Le",null,{"children":["$","$f",null,{"name":"Next.MetadataOutlet","children":"$@10"}]}]]}],{},null,false,null]},null,false,null],["$","$1","h",{"children":[null,["$","$L11",null,{"children":"$L12"}],["$","div",null,{"hidden":true,"children":["$","$L13",null,{"children":["$","$f",null,{"name":"Next.Metadata","children":"$L14"}]}]}],["$","meta",null,{"name":"next-size-adjust","content":""}]]}],false]],"m":"$undefined","G":["$15",[["$","link","0",{"rel":"stylesheet","href":"./_next/static/chunks/3xoopocxi2vi8.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"S":true,"h":null,"s":"$undefined","l":"$undefined","p":"$undefined","d":"$undefined","b":"u8vU2V6fhASeGVCpWU3eW"}
21
+ c:{}
22
+ d:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
23
+ 12:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
24
+ 16:I[27201,["./_next/static/chunks/2xjcsu4pgp14_.js","./_next/static/chunks/158myu8e_yme3.js","./_next/static/chunks/20t9qbodfrw_z.js"],"IconMark"]
25
+ 10:null
26
+ 14:[["$","title","0",{"children":"Optima"}],["$","meta","1",{"name":"description","content":"Generated by create next app"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.2vob68tjqpejf.ico","sizes":"256x256","type":"image/x-icon"}],["$","$L16","3",{}]]
@@ -5,6 +5,7 @@ declare class Logger {
5
5
  private static readonly DIM;
6
6
  private static readonly COLORS;
7
7
  static log(req: Request, res: Response, duration: number): void;
8
+ static error(message: string, ...args: unknown[]): void;
8
9
  static debug(message: string, ...args: unknown[]): void;
9
10
  static duration(message: string, duration: number): void;
10
11
  }
@@ -41,6 +41,10 @@ class Logger {
41
41
  `• ${statusCode} • ` +
42
42
  `${timing}`);
43
43
  }
44
+ static error(message, ...args) {
45
+ const timestamp = new Date().toISOString().split('T')[1].slice(0, -1);
46
+ console.error(`${Logger.DIM}[${timestamp}]${Logger.RESET} [Optima] ${Logger.COLORS.ERROR}${message}${Logger.RESET}`, ...args);
47
+ }
44
48
  static debug(message, ...args) {
45
49
  const timestamp = new Date().toISOString().split('T')[1].slice(0, -1);
46
50
  console.log(`${Logger.DIM}[${timestamp}]${Logger.RESET} [Optima] ${Logger.DIM}${message}${Logger.RESET}`, ...args);
@@ -6,10 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.attachDashboard = attachDashboard;
7
7
  const express_1 = __importDefault(require("express"));
8
8
  const path_1 = __importDefault(require("path"));
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const logger_1 = __importDefault(require("../core/telemetry/logger"));
9
11
  function attachDashboard(app, routePath = '/dashboard') {
10
- const staticAssetsPath = path_1.default.resolve(__dirname, '../../../dashboard/out');
11
- app.use(routePath, express_1.default.static(staticAssetsPath));
12
- app.get(`${routePath}/*`, (req, res) => {
13
- res.sendFile(path_1.default.join(staticAssetsPath, 'index.html'));
12
+ const dashboardDir = path_1.default.join(__dirname, '../../dashboard-out');
13
+ const indexHtmlPath = path_1.default.join(dashboardDir, 'index.html');
14
+ if (!fs_1.default.existsSync(indexHtmlPath)) {
15
+ logger_1.default.error(`Dashboard not found at ${indexHtmlPath}. Please build the dashboard first.`);
16
+ return;
17
+ }
18
+ app.use(routePath, express_1.default.static(dashboardDir));
19
+ app.get(`${routePath}*`, (req, res) => {
20
+ res.sendFile(indexHtmlPath);
14
21
  });
15
22
  }
@@ -21,6 +21,8 @@ const metrics_websocket_adapter_1 = require("./metrics-websocket.adapter");
21
21
  const metrics_bootstrap_service_1 = require("./metrics.bootstrap.service");
22
22
  const telemetry_service_1 = __importDefault(require("../core/telemetry/telemetry.service"));
23
23
  const config_1 = require("../config");
24
+ const fs_1 = __importDefault(require("fs"));
25
+ const logger_1 = __importDefault(require("../core/telemetry/logger"));
24
26
  let MetricsModule = MetricsModule_1 = class MetricsModule {
25
27
  static forRoot(options) {
26
28
  config_1.ConfigManager.getInstance().initialize(options);
@@ -41,12 +43,17 @@ let MetricsModule = MetricsModule_1 = class MetricsModule {
41
43
  return;
42
44
  }
43
45
  const dashboardRoute = config.dashboardPath;
44
- const staticAssetsPath = path_1.default.resolve(__dirname, '../../../dashboard/out');
46
+ const dashboardDir = path_1.default.join(__dirname, '../../dashboard-out');
47
+ const indexHtmlPath = path_1.default.join(dashboardDir, 'index.html');
48
+ if (!fs_1.default.existsSync(indexHtmlPath)) {
49
+ logger_1.default.error(`Dashboard not found at ${indexHtmlPath}. Please build the dashboard first.`);
50
+ return;
51
+ }
45
52
  consumer
46
- .apply(express_1.default.static(staticAssetsPath), (req, res, next) => {
53
+ .apply(express_1.default.static(dashboardDir), (req, res, next) => {
47
54
  // SPA Fallback
48
55
  if (!req.path.includes('.')) {
49
- return res.sendFile(path_1.default.join(staticAssetsPath, 'index.html'));
56
+ return res.sendFile(indexHtmlPath);
50
57
  }
51
58
  next();
52
59
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apm-optima",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "publishConfig": {
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "files": [
35
35
  "dist",
36
+ "dashboard-out",
36
37
  "README.md",
37
38
  "LICENSE",
38
39
  "package.json"