redis-smq-web-server 9.0.0-next.3 → 9.0.0-next.5
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/CHANGELOG.md +19 -0
- package/README.md +17 -10
- package/dist/cjs/src/index.d.ts +2 -0
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/cjs/src/index.js +8 -6
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/esm/src/index.d.ts +2 -0
- package/dist/esm/src/index.d.ts.map +1 -1
- package/dist/esm/src/index.js +9 -6
- package/dist/esm/src/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.0.0-next.5](https://github.com/weyoss/redis-smq/compare/v9.0.0-next.4...v9.0.0-next.5) (2025-10-12)
|
|
7
|
+
|
|
8
|
+
### 🚀 Chore
|
|
9
|
+
|
|
10
|
+
- **redis-smq-web-server:** update dependencies to latest versions ([34676ff](https://github.com/weyoss/redis-smq/commit/34676ff071c0d1f99b8b3d8efa8b1980b3e2eee6))
|
|
11
|
+
|
|
12
|
+
### 📝 Documentation
|
|
13
|
+
|
|
14
|
+
- add GitHub note callouts in README files ([86e855a](https://github.com/weyoss/redis-smq/commit/86e855ae7aea91e3295301671b8da3249164ea40))
|
|
15
|
+
- standardize "next" branch reference ([15f3e4f](https://github.com/weyoss/redis-smq/commit/15f3e4f4347fd4f76f9dc167dd72f174f178ab8e))
|
|
16
|
+
- update README files for next branch with pre-release badges and doc links ([463250b](https://github.com/weyoss/redis-smq/commit/463250bbd754d44ae6741abcf4e2d62995aef620))
|
|
17
|
+
|
|
18
|
+
## [9.0.0-next.4](https://github.com/weyoss/redis-smq/compare/v9.0.0-next.3...v9.0.0-next.4) (2025-10-09)
|
|
19
|
+
|
|
20
|
+
### ♻️ Code Refactoring
|
|
21
|
+
|
|
22
|
+
- **redis-smq-web-server:** replace console logging with app logger ([d8b3210](https://github.com/weyoss/redis-smq/commit/d8b32109929c54316630029ac8f7d9ed7fa094eb))
|
|
23
|
+
- **redis-smq-web-server:** use createLogger function ([436e2ea](https://github.com/weyoss/redis-smq/commit/436e2ea044d9e02e0916b96c1213e92e25787e8a))
|
|
24
|
+
|
|
6
25
|
## [9.0.0-next.3](https://github.com/weyoss/redis-smq/compare/v9.0.0-next.2...v9.0.0-next.3) (2025-09-09)
|
|
7
26
|
|
|
8
27
|
### 🐛 Bug Fixes
|
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# RedisSMQ Web Server
|
|
2
2
|
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> You are viewing the documentation for the "next" branch. These docs describe unreleased changes published under the npm "next" dist-tag.
|
|
5
|
+
> For the latest stable documentation, see:
|
|
6
|
+
>
|
|
7
|
+
> - Master (stable) README: https://github.com/weyoss/redis-smq/tree/master/packages/redis-smq-web-server
|
|
8
|
+
> - Latest release notes/tags: https://github.com/weyoss/redis-smq/releases/latest
|
|
9
|
+
> - Install stable packages with @latest; pre-release with @next.
|
|
10
|
+
|
|
3
11
|
A lightweight, configurable HTTP server that hosts the RedisSMQ Web UI and exposes the RedisSMQ HTTP API in the same process — or proxies it to an external API service.
|
|
4
12
|
|
|
5
13
|
- Serves the SPA (Single Page Application) for monitoring and managing RedisSMQ.
|
|
@@ -19,7 +27,7 @@ A lightweight, configurable HTTP server that hosts the RedisSMQ Web UI and expos
|
|
|
19
27
|
|
|
20
28
|
```bash
|
|
21
29
|
# Using npm
|
|
22
|
-
npm install redis-smq redis-smq-common redis-smq-rest-api redis-smq-web-ui redis-smq-web-server --save
|
|
30
|
+
npm install redis-smq@next redis-smq-common@next redis-smq-rest-api@next redis-smq-web-ui@next redis-smq-web-server@next --save
|
|
23
31
|
```
|
|
24
32
|
|
|
25
33
|
Don't forget to install a Redis client. Choose either node-redis or ioredis:
|
|
@@ -69,7 +77,7 @@ npx redis-smq-web-server \
|
|
|
69
77
|
--api-proxy-target http://127.0.0.1:7210
|
|
70
78
|
```
|
|
71
79
|
|
|
72
|
-
When `--api-proxy-target` is provided, requests to `<basePath>/api`, `<basePath>/docs`, and `<basePath>/assets` are forwarded
|
|
80
|
+
When `--api-proxy-target` is provided, requests to `<basePath>/api`, `<basePath>/docs`, and `<basePath>/assets` are forwarded
|
|
73
81
|
to the upstream. In this mode, Redis connection options on the web server are not used; the upstream API service manages Redis.
|
|
74
82
|
|
|
75
83
|
### Programmatically (optional)
|
|
@@ -125,8 +133,8 @@ await srv.run();
|
|
|
125
133
|
- UI: served from the configured base path
|
|
126
134
|
- Example: basePath = / → UI at /
|
|
127
135
|
- Example: basePath = /redis-smq → UI at /redis-smq
|
|
128
|
-
|
|
129
136
|
- HTTP API: mounted under <basePath>/api
|
|
137
|
+
|
|
130
138
|
- Example: basePath = / → API at /api
|
|
131
139
|
- Example: basePath = /redis-smq → API at /redis-smq/api
|
|
132
140
|
|
|
@@ -175,12 +183,12 @@ interface IRedisSMQWebServerConfig extends IRedisSMQRestApiConfig {
|
|
|
175
183
|
|
|
176
184
|
Notes:
|
|
177
185
|
|
|
178
|
-
- When `webServer.apiProxyTarget` is set, the server proxies `<basePath>/api`, `<basePath>/docs`, and
|
|
179
|
-
`<basePath>/assets` to the target. In this mode, redis and logger options are not used by the web server (they are
|
|
180
|
-
handled by the upstream API service).
|
|
186
|
+
- When `webServer.apiProxyTarget` is set, the server proxies `<basePath>/api`, `<basePath>/docs`, and
|
|
187
|
+
`<basePath>/assets` to the target. In this mode, redis and logger options are not used by the web server (they are
|
|
188
|
+
handled by the upstream API service).
|
|
181
189
|
|
|
182
|
-
- When `webServer.apiProxyTarget` is not set, the web server mounts the embedded `redis-smq-rest-api` using the provided
|
|
183
|
-
`IRedisSMQRestApiConfig` (redis, logger, etc.).
|
|
190
|
+
- When `webServer.apiProxyTarget` is not set, the web server mounts the embedded `redis-smq-rest-api` using the provided
|
|
191
|
+
`IRedisSMQRestApiConfig` (redis, logger, etc.).
|
|
184
192
|
|
|
185
193
|
### ClI flags
|
|
186
194
|
|
|
@@ -209,5 +217,4 @@ handled by the upstream API service).
|
|
|
209
217
|
|
|
210
218
|
## License
|
|
211
219
|
|
|
212
|
-
RedisSMQ Web Server is licensed under is released under the [MIT License](
|
|
213
|
-
|
|
220
|
+
RedisSMQ Web Server is licensed under is released under the [MIT License](/LICENSE).
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRedisSMQWebServerConfig } from './config/types/index.js';
|
|
2
|
+
import { ILogger } from 'redis-smq-common';
|
|
2
3
|
export declare class RedisSMQWebServer {
|
|
3
4
|
private readonly app;
|
|
4
5
|
private readonly config;
|
|
@@ -8,6 +9,7 @@ export declare class RedisSMQWebServer {
|
|
|
8
9
|
private restApi;
|
|
9
10
|
private bootstrapped;
|
|
10
11
|
private httpServer;
|
|
12
|
+
protected logger: ILogger;
|
|
11
13
|
constructor(config?: IRedisSMQWebServerConfig);
|
|
12
14
|
private setupMiddleware;
|
|
13
15
|
private setupApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAgB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAA4B;IAC9C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEd,MAAM,GAAE,wBAA6B;YAYnC,eAAe;YAsBf,QAAQ;YAuBR,WAAW;YAoCX,SAAS;IAQV,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAcpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBvC"}
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -20,6 +20,7 @@ const redis_smq_web_ui_1 = require("redis-smq-web-ui");
|
|
|
20
20
|
const redis_smq_rest_api_1 = require("redis-smq-rest-api");
|
|
21
21
|
const parse_config_js_1 = require("./config/parse-config.js");
|
|
22
22
|
const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
23
|
+
const redis_smq_common_1 = require("redis-smq-common");
|
|
23
24
|
class RedisSMQWebServer {
|
|
24
25
|
constructor(config = {}) {
|
|
25
26
|
var _a;
|
|
@@ -35,6 +36,7 @@ class RedisSMQWebServer {
|
|
|
35
36
|
};
|
|
36
37
|
this.apiProxyTarget = (_a = this.config.webServer.apiProxyTarget) !== null && _a !== void 0 ? _a : null;
|
|
37
38
|
this.webUIPath = (0, redis_smq_web_ui_1.getDistPath)();
|
|
39
|
+
this.logger = (0, redis_smq_common_1.createLogger)(this.config.logger, 'RedisSMQWebServer');
|
|
38
40
|
}
|
|
39
41
|
setupMiddleware() {
|
|
40
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -80,7 +82,7 @@ class RedisSMQWebServer {
|
|
|
80
82
|
const indexPath = path_1.default.join(this.webUIPath, 'index.html');
|
|
81
83
|
fs_1.default.readFile(indexPath, 'utf8', (err, data) => {
|
|
82
84
|
if (err) {
|
|
83
|
-
|
|
85
|
+
this.logger.error('Error reading index.html:', err);
|
|
84
86
|
return res.status(500).send('Error loading application');
|
|
85
87
|
}
|
|
86
88
|
const configScript = `<script>window.configs = ${JSON.stringify(this.webUIConfig)};</script>`;
|
|
@@ -104,14 +106,14 @@ class RedisSMQWebServer {
|
|
|
104
106
|
yield this.bootstrap();
|
|
105
107
|
const port = this.config.webServer.port;
|
|
106
108
|
this.httpServer = this.app.listen(port, () => {
|
|
107
|
-
|
|
109
|
+
this.logger.info(`Redis SMQ Web Server running on port ${port}`);
|
|
108
110
|
if (this.apiProxyTarget) {
|
|
109
|
-
|
|
111
|
+
this.logger.info(`Proxying API requests to ${this.apiProxyTarget}`);
|
|
110
112
|
}
|
|
111
113
|
else {
|
|
112
|
-
|
|
114
|
+
this.logger.info(`Embedded Redis SMQ REST API is mounted`);
|
|
113
115
|
}
|
|
114
|
-
|
|
116
|
+
this.logger.info(`Serving static assets from: ${this.webUIPath}`);
|
|
115
117
|
});
|
|
116
118
|
});
|
|
117
119
|
}
|
|
@@ -127,7 +129,7 @@ class RedisSMQWebServer {
|
|
|
127
129
|
});
|
|
128
130
|
});
|
|
129
131
|
this.httpServer = null;
|
|
130
|
-
|
|
132
|
+
this.logger.info('Redis SMQ Web Server has been shutdown.');
|
|
131
133
|
}
|
|
132
134
|
if (this.restApi) {
|
|
133
135
|
yield this.restApi.shutdown();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA,sDAA8B;AAC9B,gDAAwB;AACxB,4CAAoB;AAEpB,uDAA+C;AAK/C,2DAAqD;AACrD,8DAAuD;AAEvD,iEAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AASA,sDAA8B;AAC9B,gDAAwB;AACxB,4CAAoB;AAEpB,uDAA+C;AAK/C,2DAAqD;AACrD,8DAAuD;AA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,+BAA+B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;YACpE,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;IAEY,QAAQ;;YAEnB,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;gBACjD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;;oBAC1C,MAAA,IAAI,CAAC,UAAU,0CAAE,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE;wBACrC,IAAI,GAAG;4BAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC5B,OAAO,EAAE,CAAC;oBACZ,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBACH,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;YAC9D,CAAC;YAGD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACtB,CAAC;QACH,CAAC;KAAA;CACF;AAjJD,8CAiJC"}
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRedisSMQWebServerConfig } from './config/types/index.js';
|
|
2
|
+
import { ILogger } from 'redis-smq-common';
|
|
2
3
|
export declare class RedisSMQWebServer {
|
|
3
4
|
private readonly app;
|
|
4
5
|
private readonly config;
|
|
@@ -8,6 +9,7 @@ export declare class RedisSMQWebServer {
|
|
|
8
9
|
private restApi;
|
|
9
10
|
private bootstrapped;
|
|
10
11
|
private httpServer;
|
|
12
|
+
protected logger: ILogger;
|
|
11
13
|
constructor(config?: IRedisSMQWebServerConfig);
|
|
12
14
|
private setupMiddleware;
|
|
13
15
|
private setupApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAgB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiC;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IACtD,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAA4B;IAC9C,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEd,MAAM,GAAE,wBAA6B;YAYnC,eAAe;YAsBf,QAAQ;YAuBR,WAAW;YAoCX,SAAS;IAQV,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAcpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBvC"}
|
package/dist/esm/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { getDistPath } from 'redis-smq-web-ui';
|
|
|
5
5
|
import { RedisSMQRestApi } from 'redis-smq-rest-api';
|
|
6
6
|
import { parseConfig } from './config/parse-config.js';
|
|
7
7
|
import { createProxyMiddleware } from 'http-proxy-middleware';
|
|
8
|
+
import { createLogger } from 'redis-smq-common';
|
|
8
9
|
export class RedisSMQWebServer {
|
|
9
10
|
app = express();
|
|
10
11
|
config;
|
|
@@ -14,6 +15,7 @@ export class RedisSMQWebServer {
|
|
|
14
15
|
restApi = null;
|
|
15
16
|
bootstrapped = false;
|
|
16
17
|
httpServer = null;
|
|
18
|
+
logger;
|
|
17
19
|
constructor(config = {}) {
|
|
18
20
|
this.config = parseConfig(config);
|
|
19
21
|
this.webUIConfig = {
|
|
@@ -22,6 +24,7 @@ export class RedisSMQWebServer {
|
|
|
22
24
|
};
|
|
23
25
|
this.apiProxyTarget = this.config.webServer.apiProxyTarget ?? null;
|
|
24
26
|
this.webUIPath = getDistPath();
|
|
27
|
+
this.logger = createLogger(this.config.logger, 'RedisSMQWebServer');
|
|
25
28
|
}
|
|
26
29
|
async setupMiddleware() {
|
|
27
30
|
this.app.use(express.static(this.webUIPath, {
|
|
@@ -62,7 +65,7 @@ export class RedisSMQWebServer {
|
|
|
62
65
|
const indexPath = path.join(this.webUIPath, 'index.html');
|
|
63
66
|
fs.readFile(indexPath, 'utf8', (err, data) => {
|
|
64
67
|
if (err) {
|
|
65
|
-
|
|
68
|
+
this.logger.error('Error reading index.html:', err);
|
|
66
69
|
return res.status(500).send('Error loading application');
|
|
67
70
|
}
|
|
68
71
|
const configScript = `<script>window.configs = ${JSON.stringify(this.webUIConfig)};</script>`;
|
|
@@ -82,14 +85,14 @@ export class RedisSMQWebServer {
|
|
|
82
85
|
await this.bootstrap();
|
|
83
86
|
const port = this.config.webServer.port;
|
|
84
87
|
this.httpServer = this.app.listen(port, () => {
|
|
85
|
-
|
|
88
|
+
this.logger.info(`Redis SMQ Web Server running on port ${port}`);
|
|
86
89
|
if (this.apiProxyTarget) {
|
|
87
|
-
|
|
90
|
+
this.logger.info(`Proxying API requests to ${this.apiProxyTarget}`);
|
|
88
91
|
}
|
|
89
92
|
else {
|
|
90
|
-
|
|
93
|
+
this.logger.info(`Embedded Redis SMQ REST API is mounted`);
|
|
91
94
|
}
|
|
92
|
-
|
|
95
|
+
this.logger.info(`Serving static assets from: ${this.webUIPath}`);
|
|
93
96
|
});
|
|
94
97
|
}
|
|
95
98
|
async shutdown() {
|
|
@@ -102,7 +105,7 @@ export class RedisSMQWebServer {
|
|
|
102
105
|
});
|
|
103
106
|
});
|
|
104
107
|
this.httpServer = null;
|
|
105
|
-
|
|
108
|
+
this.logger.info('Redis SMQ Web Server has been shutdown.');
|
|
106
109
|
}
|
|
107
110
|
if (this.restApi) {
|
|
108
111
|
await this.restApi.shutdown();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AASA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AASA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAEzD,MAAM,OAAO,iBAAiB;IACX,GAAG,GAAG,OAAO,EAAE,CAAC;IAChB,MAAM,CAAiC;IACvC,SAAS,CAAS;IAClB,WAAW,CAAuB;IAClC,cAAc,GAAkB,IAAI,CAAC;IAC9C,OAAO,GAA2B,IAAI,CAAC;IACvC,YAAY,GA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AO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE;oBACrC,IAAI,GAAG;wBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC5B,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QAC9D,CAAC;QAGD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redis-smq-web-server",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.5",
|
|
4
4
|
"description": "Web server for RedisSMQ Web UI: serves the SPA and hosts or proxies the RedisSMQ REST API.",
|
|
5
5
|
"author": "Weyoss <weyoss@protonmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"redis-smq-web-server": "./dist/esm/bin/cli.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"commander": "
|
|
38
|
+
"commander": "14.0.1",
|
|
39
39
|
"express": "4.21.2",
|
|
40
40
|
"http-proxy-middleware": "3.0.5"
|
|
41
41
|
},
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@types/express": "4.17.23"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@redis/client": "^
|
|
47
|
-
"ioredis": "^5
|
|
48
|
-
"redis-smq": "^9.0.0-next.
|
|
49
|
-
"redis-smq-common": "^9.0.0-next.
|
|
50
|
-
"redis-smq-rest-api": "^9.0.0-next.
|
|
51
|
-
"redis-smq-web-ui": "^9.0.0-next.
|
|
46
|
+
"@redis/client": "^5",
|
|
47
|
+
"ioredis": "^5",
|
|
48
|
+
"redis-smq": "^9.0.0-next.5",
|
|
49
|
+
"redis-smq-common": "^9.0.0-next.5",
|
|
50
|
+
"redis-smq-rest-api": "^9.0.0-next.5",
|
|
51
|
+
"redis-smq-web-ui": "^9.0.0-next.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@redis/client": {
|