@colyseus/monitor 0.16.0-preview.2 → 0.16.0

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 (36) hide show
  1. package/build/api.d.ts +1 -1
  2. package/build/api.js +95 -80
  3. package/build/api.js.map +7 -0
  4. package/build/api.mjs +68 -0
  5. package/build/api.mjs.map +7 -0
  6. package/build/ext/Room.js +62 -68
  7. package/build/ext/Room.js.map +7 -0
  8. package/build/ext/Room.mjs +72 -0
  9. package/build/ext/Room.mjs.map +7 -0
  10. package/build/index.d.ts +1 -1
  11. package/build/index.js +44 -18
  12. package/build/index.js.map +7 -0
  13. package/build/index.mjs +15 -0
  14. package/build/index.mjs.map +7 -0
  15. package/build/{static/build/frontend → src}/components/RoomList.d.ts +1 -0
  16. package/build/src/services.d.ts +3 -0
  17. package/build/{static/build → src-backend}/api.d.ts +1 -1
  18. package/build/{static/build → src-backend}/index.d.ts +1 -1
  19. package/build/static/bundle.js +24 -24
  20. package/build/static/bundle.js.map +1 -1
  21. package/build/static/styles.css +148 -137
  22. package/build/static/styles.css.map +1 -1
  23. package/build.mjs +90 -0
  24. package/package.json +10 -9
  25. package/src-backend/api.ts +84 -0
  26. package/src-backend/ext/Room.ts +67 -0
  27. package/src-backend/index.ts +31 -0
  28. package/tsconfig.json +5 -4
  29. package/webpack.config.js +2 -2
  30. package/build/static/build/frontend/services.d.ts +0 -5
  31. /package/build/{static/build/frontend → src}/App.d.ts +0 -0
  32. /package/build/{static/build/frontend → src}/components/CAppBar.d.ts +0 -0
  33. /package/build/{static/build/frontend → src}/components/RoomInspect.d.ts +0 -0
  34. /package/build/{static/build/frontend → src}/helpers/helpers.d.ts +0 -0
  35. /package/build/{static/build/frontend → src}/index.d.ts +0 -0
  36. /package/build/{static/build → src-backend}/ext/Room.d.ts +0 -0
@@ -0,0 +1,15 @@
1
+ // src-backend/index.ts
2
+ import express from "express";
3
+ import path from "path";
4
+ import { getAPI } from "./api.mjs";
5
+ import "./ext/Room.mjs";
6
+ var frontendDirectory = path.resolve(__dirname, "..", "build", "static");
7
+ function monitor(opts = {}) {
8
+ const router = express.Router();
9
+ router.use(express.static(frontendDirectory));
10
+ router.use("/api", getAPI(opts));
11
+ return router;
12
+ }
13
+ export {
14
+ monitor
15
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src-backend/index.ts"],
4
+ "sourcesContent": ["import express from 'express';\nimport path from 'path';\n\nimport { getAPI } from './api.js';\nimport './ext/Room.js';\n\nconst frontendDirectory = path.resolve(__dirname, \"..\", \"build\", \"static\");\n\nexport interface MonitorOptions {\n columns: Array<\n 'roomId' |\n 'name' |\n 'clients' |\n 'maxClients' |\n 'locked' |\n 'elapsedTime' |\n { metadata: string } |\n 'processId' |\n \"publicAddress\"\n >\n}\n\n/**\n * TODO: expose the `router` instead on next major version.\n */\nexport function monitor (opts: Partial<MonitorOptions> = {}): express.Router {\n const router = express.Router();\n router.use(express.static(frontendDirectory));\n router.use('/api', getAPI(opts));\n return router;\n}\n"],
5
+ "mappings": ";AAAA,OAAO,aAAa;AACpB,OAAO,UAAU;AAEjB,SAAS,cAAc;AACvB,OAAO;AAEP,IAAM,oBAAoB,KAAK,QAAQ,WAAW,MAAM,SAAS,QAAQ;AAmBlE,SAAS,QAAS,OAAgC,CAAC,GAAmB;AACzE,QAAM,SAAS,QAAQ,OAAO;AAC9B,SAAO,IAAI,QAAQ,OAAO,iBAAiB,CAAC;AAC5C,SAAO,IAAI,QAAQ,OAAO,IAAI,CAAC;AAC/B,SAAO;AACX;",
6
+ "names": []
7
+ }
@@ -15,6 +15,7 @@ export declare class RoomList extends React.Component {
15
15
  updateRoomListInterval: number;
16
16
  isSelected: (index: any) => boolean;
17
17
  componentWillMount(): void;
18
+ componentWillUnmount(): void;
18
19
  fetchRoomList(): Promise<void>;
19
20
  handleRowSelection: (selectedRows: any) => void;
20
21
  inspectRoom(roomId: any): void;
@@ -0,0 +1,3 @@
1
+ export declare function fetchRoomList(): Promise<any>;
2
+ export declare function fetchRoomData(roomId: string): Promise<any>;
3
+ export declare function remoteRoomCall(roomId: string, method: string, ...args: any[]): Promise<any>;
@@ -1,2 +1,2 @@
1
- import { MonitorOptions } from ".";
1
+ import type { MonitorOptions } from './index.js';
2
2
  export declare function getAPI(opts: Partial<MonitorOptions>): any;
@@ -1,5 +1,5 @@
1
1
  import express from 'express';
2
- import './ext/Room';
2
+ import './ext/Room.js';
3
3
  export interface MonitorOptions {
4
4
  columns: Array<'roomId' | 'name' | 'clients' | 'maxClients' | 'locked' | 'elapsedTime' | {
5
5
  metadata: string;