redis-smq-web-server 9.0.0-next.2 → 9.0.0-next.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.
- package/CHANGELOG.md +23 -0
- package/README.md +84 -64
- package/dist/cjs/bin/cli.js +41 -7
- package/dist/cjs/bin/cli.js.map +1 -1
- package/dist/cjs/src/config/parse-config.d.ts.map +1 -1
- package/dist/cjs/src/config/parse-config.js +15 -29
- package/dist/cjs/src/config/parse-config.js.map +1 -1
- package/dist/cjs/src/config/types/index.d.ts +16 -5
- package/dist/cjs/src/config/types/index.d.ts.map +1 -1
- package/dist/cjs/src/index.d.ts +3 -1
- 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/bin/cli.js +40 -7
- package/dist/esm/bin/cli.js.map +1 -1
- package/dist/esm/src/config/parse-config.d.ts.map +1 -1
- package/dist/esm/src/config/parse-config.js +17 -28
- package/dist/esm/src/config/parse-config.js.map +1 -1
- package/dist/esm/src/config/types/index.d.ts +16 -5
- package/dist/esm/src/config/types/index.d.ts.map +1 -1
- package/dist/esm/src/index.d.ts +3 -1
- 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 +16 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
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.4](https://github.com/weyoss/redis-smq/compare/v9.0.0-next.3...v9.0.0-next.4) (2025-10-09)
|
|
7
|
+
|
|
8
|
+
### ♻️ Code Refactoring
|
|
9
|
+
|
|
10
|
+
- **redis-smq-web-server:** replace console logging with app logger ([d8b3210](https://github.com/weyoss/redis-smq/commit/d8b32109929c54316630029ac8f7d9ed7fa094eb))
|
|
11
|
+
- **redis-smq-web-server:** use createLogger function ([436e2ea](https://github.com/weyoss/redis-smq/commit/436e2ea044d9e02e0916b96c1213e92e25787e8a))
|
|
12
|
+
|
|
13
|
+
## [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)
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug Fixes
|
|
16
|
+
|
|
17
|
+
- **redis-smq-web-server:** set default Redis database to 0 ([3b4e200](https://github.com/weyoss/redis-smq/commit/3b4e200681a5e1eec2446fa6ffa27878cb790b29))
|
|
18
|
+
- **redis-smq-web-server:** update peer dependencies ([2be664e](https://github.com/weyoss/redis-smq/commit/2be664ea4bacffd5b0a780e05355e356028b6321))
|
|
19
|
+
|
|
20
|
+
### 📝 Documentation
|
|
21
|
+
|
|
22
|
+
- **redis-smq-rest-api:** add Redis client installation instructions ([40d9d54](https://github.com/weyoss/redis-smq/commit/40d9d541274701b6b701505e70d9f5ee8add0912))
|
|
23
|
+
- **redis-smq-web-server:** update configuration API and CLI options ([873bedf](https://github.com/weyoss/redis-smq/commit/873bedf848bf7098010cf67b3a886e50864021c4))
|
|
24
|
+
|
|
25
|
+
### ♻️ Code Refactoring
|
|
26
|
+
|
|
27
|
+
- **redis-smq-web-server:** improve CLI configuration and config parsing ([8ec1d84](https://github.com/weyoss/redis-smq/commit/8ec1d840678eb360a7854453cd6e20976d872c5c))
|
|
28
|
+
|
|
6
29
|
## [9.0.0-next.2](https://github.com/weyoss/redis-smq/compare/v9.0.0-next.1...v9.0.0-next.2) (2025-09-07)
|
|
7
30
|
|
|
8
31
|
### 🐛 Bug Fixes
|
package/README.md
CHANGED
|
@@ -22,6 +22,14 @@ A lightweight, configurable HTTP server that hosts the RedisSMQ Web UI and expos
|
|
|
22
22
|
npm install redis-smq redis-smq-common redis-smq-rest-api redis-smq-web-ui redis-smq-web-server --save
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
Don't forget to install a Redis client. Choose either node-redis or ioredis:
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
npm install @redis/client --save
|
|
29
|
+
# or
|
|
30
|
+
npm install ioredis --save
|
|
31
|
+
```
|
|
32
|
+
|
|
25
33
|
## Quick Start
|
|
26
34
|
|
|
27
35
|
### From the Command Line
|
|
@@ -68,51 +76,48 @@ to the upstream. In this mode, Redis connection options on the web server are no
|
|
|
68
76
|
|
|
69
77
|
If you prefer embedding the server in your app, you can pass the same configuration programmatically.
|
|
70
78
|
|
|
71
|
-
#### ESM / TypeScript
|
|
72
|
-
|
|
73
79
|
```typescript
|
|
74
80
|
import { RedisSMQWebServer } from 'redis-smq-web-server';
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
import { EConsoleLoggerLevel, ERedisConfigClient } from 'redis-smq-common';
|
|
82
|
+
|
|
83
|
+
// Run with the embedded REST API (in-process)
|
|
84
|
+
const server = new RedisSMQWebServer({
|
|
85
|
+
webServer: {
|
|
86
|
+
port: 8080,
|
|
87
|
+
basePath: '/', // UI at '/', API at '/api', docs at '/docs'
|
|
88
|
+
},
|
|
89
|
+
// The following options are used only when apiProxyTarget is NOT set
|
|
90
|
+
redis: {
|
|
91
|
+
client: ERedisConfigClient.IOREDIS,
|
|
92
|
+
options: {
|
|
93
|
+
host: '127.0.0.1',
|
|
94
|
+
port: 6379,
|
|
95
|
+
db: 1,
|
|
96
|
+
showFriendlyErrorStack: true,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
logger: {
|
|
100
|
+
enabled: true,
|
|
101
|
+
options: {
|
|
102
|
+
level: EConsoleLoggerLevel.INFO,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
84
105
|
});
|
|
85
106
|
|
|
86
|
-
|
|
87
|
-
await
|
|
88
|
-
port: 8080,
|
|
89
|
-
apiProxyTarget: 'http://127.0.0.1:7210',
|
|
90
|
-
});
|
|
107
|
+
await server.run();
|
|
108
|
+
// await server.shutdown();
|
|
91
109
|
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const redisSMQWebServer = new RedisSMQWebServer();
|
|
102
|
-
|
|
103
|
-
redisSMQWebServer.run({
|
|
104
|
-
port: 8080,
|
|
105
|
-
basePath: '/',
|
|
106
|
-
redisHost: '127.0.0.1',
|
|
107
|
-
redisPort: 6379,
|
|
108
|
-
redisDB: '1',
|
|
110
|
+
// Or proxy API/docs/assets to an external service
|
|
111
|
+
const srv = new RedisSMQWebServer({
|
|
112
|
+
webServer: {
|
|
113
|
+
port: 8080,
|
|
114
|
+
basePath: '/', // or '/redis-smq'
|
|
115
|
+
apiProxyTarget: 'http://127.0.0.1:7210',
|
|
116
|
+
},
|
|
117
|
+
// No redis/logger config required in proxy mode
|
|
109
118
|
});
|
|
110
119
|
|
|
111
|
-
|
|
112
|
-
redisSMQWebServer.run({
|
|
113
|
-
port: 8080,
|
|
114
|
-
apiProxyTarget: 'http://127.0.0.1:7210',
|
|
115
|
-
});
|
|
120
|
+
await srv.run();
|
|
116
121
|
```
|
|
117
122
|
|
|
118
123
|
## Routes
|
|
@@ -142,39 +147,54 @@ Proxying behavior:
|
|
|
142
147
|
Configuration can be provided programmatically or via CLI arguments. The core interface is:
|
|
143
148
|
|
|
144
149
|
```typescript
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
150
|
+
import type { IRedisSMQRestApiConfig } from 'redis-smq-rest-api';
|
|
151
|
+
|
|
152
|
+
interface IRedisSMQWebServerConfig extends IRedisSMQRestApiConfig {
|
|
153
|
+
webServer?: {
|
|
154
|
+
/**
|
|
155
|
+
* HTTP port to run the web server on.
|
|
156
|
+
* Default: 8080
|
|
157
|
+
*/
|
|
158
|
+
port?: number;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Base public path for the RedisSMQ Web UI and the local API/docs when embedded.
|
|
162
|
+
* Default: '/'
|
|
163
|
+
*/
|
|
164
|
+
basePath?: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Optional target for proxying (/api, /docs, /assets).
|
|
168
|
+
* If provided, the embedded REST API is not mounted and requests are forwarded to the target.
|
|
169
|
+
* Example: 'http://127.0.0.1:7210'
|
|
170
|
+
*/
|
|
171
|
+
apiProxyTarget?: string;
|
|
172
|
+
};
|
|
156
173
|
}
|
|
157
174
|
```
|
|
158
175
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- apiProxyTarget
|
|
176
|
+
Notes:
|
|
177
|
+
|
|
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).
|
|
181
|
+
|
|
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.).
|
|
166
184
|
|
|
167
185
|
### ClI flags
|
|
168
186
|
|
|
169
187
|
```shell
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
188
|
+
-p, --port <number> Port to run the server on (default: "8080")
|
|
189
|
+
-b, --base-path <string> Base public path for the RedisSMQ Web UI SPA (default: "/")
|
|
190
|
+
-t, --api-proxy-target <string> Proxy target for API (/api, /docs, /assets). Example: http://127.0.0.1:6000
|
|
191
|
+
-c, --redis-client <ioredis|redis> Redis client. Valid options are: ioredis, redis. (default: "ioredis")
|
|
192
|
+
-r, --redis-host <string> Redis server host (default: "127.0.0.1")
|
|
193
|
+
-o, --redis-port <number> Redis server port (default: "6379")
|
|
194
|
+
-d, --redis-db <number> Redis database number (default: "0")
|
|
195
|
+
-e, --enable-log <0|1> Enable console logging. Valid options are: 0, 1 (default: "0")
|
|
196
|
+
-v, --log-level <0|1|2|3> Log level. Numbers: 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (default: "1")
|
|
197
|
+
-h, --help display help for command
|
|
178
198
|
```
|
|
179
199
|
|
|
180
200
|
## Deploying behind a reverse proxy
|
package/dist/cjs/bin/cli.js
CHANGED
|
@@ -1,22 +1,56 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var _a, _b, _c;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
5
|
const commander_1 = require("commander");
|
|
5
6
|
const index_js_1 = require("../src/index.js");
|
|
6
7
|
const parse_config_js_1 = require("../src/config/parse-config.js");
|
|
8
|
+
const redis_smq_common_1 = require("redis-smq-common");
|
|
9
|
+
const redis_smq_1 = require("redis-smq");
|
|
10
|
+
const defaultLogLevel = typeof redis_smq_1.defaultConfig.logger.options.logLevel === 'number'
|
|
11
|
+
? redis_smq_1.defaultConfig.logger.options.logLevel
|
|
12
|
+
: redis_smq_common_1.EConsoleLoggerLevel[redis_smq_1.defaultConfig.logger.options.logLevel];
|
|
7
13
|
const program = new commander_1.Command();
|
|
8
14
|
program
|
|
9
15
|
.name('redis-smq-web-server')
|
|
10
16
|
.description('Web server for RedisSMQ Web UI');
|
|
11
17
|
program
|
|
12
|
-
.option('-p, --port <
|
|
13
|
-
.option('-
|
|
14
|
-
.option('-
|
|
15
|
-
.option('-
|
|
16
|
-
.option('-
|
|
17
|
-
.option('-
|
|
18
|
+
.option('-p, --port <number>', 'Port to run the server on', String((_a = parse_config_js_1.defaultConfig.webServer) === null || _a === void 0 ? void 0 : _a.port))
|
|
19
|
+
.option('-b, --base-path <string>', 'Base public path for the RedisSMQ Web UI SPA', (_b = parse_config_js_1.defaultConfig.webServer) === null || _b === void 0 ? void 0 : _b.basePath)
|
|
20
|
+
.option('-t, --api-proxy-target <string>', 'Proxy target for API (/api, /docs, /assets). Example: http://127.0.0.1:6000', (_c = parse_config_js_1.defaultConfig.webServer) === null || _c === void 0 ? void 0 : _c.apiProxyTarget)
|
|
21
|
+
.option('-c, --redis-client <ioredis|redis>', 'Redis client. Valid options are: ioredis, redis.', redis_smq_1.defaultConfig.redis.client)
|
|
22
|
+
.option('-r, --redis-host <string>', 'Redis server host', redis_smq_1.defaultConfig.redis.options.host)
|
|
23
|
+
.option('-o, --redis-port <number>', 'Redis server port', String(redis_smq_1.defaultConfig.redis.options.port))
|
|
24
|
+
.option('-d, --redis-db <number>', 'Redis database number', String(redis_smq_1.defaultConfig.redis.options.db))
|
|
25
|
+
.option('-e, --enable-log <0|1>', 'Enable console logging. Valid options are: 0, 1', String(Number(redis_smq_1.defaultConfig.logger.enabled)))
|
|
26
|
+
.option('-v, --log-level <0|1|2|3>', `Log level. Numbers: ${redis_smq_common_1.EConsoleLoggerLevel.DEBUG}=DEBUG, ${redis_smq_common_1.EConsoleLoggerLevel.INFO}=INFO, ${redis_smq_common_1.EConsoleLoggerLevel.WARN}=WARN, ${redis_smq_common_1.EConsoleLoggerLevel.ERROR}=ERROR`, String(defaultLogLevel));
|
|
18
27
|
program.parse();
|
|
19
28
|
const options = program.opts();
|
|
20
|
-
const
|
|
29
|
+
const config = {
|
|
30
|
+
webServer: {
|
|
31
|
+
port: Number(options.port),
|
|
32
|
+
basePath: options.basePath,
|
|
33
|
+
apiProxyTarget: options.apiProxyTarget,
|
|
34
|
+
},
|
|
35
|
+
apiServer: {
|
|
36
|
+
port: Number(options.port),
|
|
37
|
+
basePath: options.basePath,
|
|
38
|
+
},
|
|
39
|
+
redis: {
|
|
40
|
+
client: options.redisClient,
|
|
41
|
+
options: {
|
|
42
|
+
host: options.redisHost,
|
|
43
|
+
port: Number(options.redisPort),
|
|
44
|
+
db: Number(options.redisDb),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
logger: {
|
|
48
|
+
enabled: Boolean(Number(options.enableLog)),
|
|
49
|
+
options: {
|
|
50
|
+
logLevel: Number(options.logLevel),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const server = new index_js_1.RedisSMQWebServer(config);
|
|
21
55
|
server.run();
|
|
22
56
|
//# sourceMappingURL=cli.js.map
|
package/dist/cjs/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../bin/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../bin/cli.ts"],"names":[],"mappings":";;;;AAWA,yCAAoC;AACpC,8CAAoD;AAKpD,mEAA8D;AAC9D,uDAAuD;AACvD,yCAAmE;AAEnE,MAAM,eAAe,GACnB,OAAO,yBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ;IAC/D,CAAC,CAAC,yBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ;IAC/C,CAAC,CAAC,sCAAmB,CAAC,yBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzE,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,sBAAsB,CAAC;KAC5B,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAEjD,OAAO;KACJ,MAAM,CACL,qBAAqB,EACrB,2BAA2B,EAC3B,MAAM,CAAC,MAAA,+BAAa,CAAC,SAAS,0CAAE,IAAI,CAAC,CACtC;KACA,MAAM,CACL,0BAA0B,EAC1B,8CAA8C,EAC9C,MAAA,+BAAa,CAAC,SAAS,0CAAE,QAAQ,CAClC;KACA,MAAM,CACL,iCAAiC,EACj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AAO,EAAE;YACP,IAAI,EAAE,OAAO,CAAC,SAAS;YACvB,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAC/B,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC5B;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACnC;KACF;CACF,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,4BAAiB,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AASA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AASA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,wBAM3B,CAAC;AAMF,wBAAgB,WAAW,CACzB,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,8BAA8B,CAgBhC"}
|
|
@@ -2,37 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultConfig = void 0;
|
|
4
4
|
exports.parseConfig = parseConfig;
|
|
5
|
-
const
|
|
5
|
+
const redis_smq_rest_api_1 = require("redis-smq-rest-api");
|
|
6
6
|
exports.defaultConfig = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
apiProxyTarget: undefined,
|
|
7
|
+
webServer: {
|
|
8
|
+
port: 8080,
|
|
9
|
+
basePath: '/',
|
|
10
|
+
apiProxyTarget: undefined,
|
|
11
|
+
},
|
|
13
12
|
};
|
|
14
13
|
function parseConfig(config = {}) {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
options: {
|
|
25
|
-
port: cfg.redisPort,
|
|
26
|
-
host: cfg.redisHost,
|
|
27
|
-
db: cfg.redisDB,
|
|
28
|
-
showFriendlyErrorStack: true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
webServer: webServerCfg,
|
|
32
|
-
apiServer: {
|
|
33
|
-
port: cfg.port,
|
|
34
|
-
basePath: cfg.basePath,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
14
|
+
const restApiParsedConfig = (0, redis_smq_rest_api_1.parseConfig)(config);
|
|
15
|
+
const webServer = Object.assign(Object.assign({}, exports.defaultConfig.webServer), config.webServer);
|
|
16
|
+
return Object.assign(Object.assign({}, restApiParsedConfig), { webServer: {
|
|
17
|
+
port: Number(webServer.port),
|
|
18
|
+
basePath: String(webServer.basePath),
|
|
19
|
+
apiProxyTarget: webServer.apiProxyTarget
|
|
20
|
+
? String(webServer.apiProxyTarget)
|
|
21
|
+
: undefined,
|
|
22
|
+
} });
|
|
37
23
|
}
|
|
38
24
|
//# sourceMappingURL=parse-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":";;;AA2BA,kCAkBC;AAhCD,2DAAuE;AAE1D,QAAA,aAAa,GAA6B;IACrD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,GAAG;QACb,cAAc,EAAE,SAAS;KAC1B;CACF,CAAC;AAMF,SAAgB,WAAW,CACzB,SAA4C,EAAE;IAE9C,MAAM,mBAAmB,GAAG,IAAA,gCAAkB,EAAC,MAAM,CAAC,CAAC;IACvD,MAAM,SAAS,mCACV,qBAAa,CAAC,SAAS,GACvB,MAAM,CAAC,SAAS,CACpB,CAAC;IACF,uCACK,mBAAmB,KACtB,SAAS,EAAE;YACT,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YAC5B,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;YACpC,cAAc,EAAE,SAAS,CAAC,cAAc;gBACtC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;gBAClC,CAAC,CAAC,SAAS;SACd,IACD;AACJ,CAAC"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { IRedisSMQRestApiParsedConfig } from 'redis-smq-rest-api';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IRedisSMQRestApiConfig, IRedisSMQRestApiParsedConfig } from 'redis-smq-rest-api';
|
|
2
|
+
import { EConsoleLoggerLevel, ERedisConfigClient } from 'redis-smq-common';
|
|
3
|
+
export interface IRedisSMQWebServerCliOptions {
|
|
4
|
+
port: string;
|
|
4
5
|
basePath: string;
|
|
5
|
-
|
|
6
|
+
redisClient: ERedisConfigClient;
|
|
7
|
+
redisPort: string;
|
|
6
8
|
redisHost: string;
|
|
7
|
-
|
|
9
|
+
redisDb: string;
|
|
10
|
+
enableLog: string;
|
|
11
|
+
logLevel: EConsoleLoggerLevel;
|
|
8
12
|
apiProxyTarget?: string;
|
|
9
13
|
}
|
|
14
|
+
export interface IRedisSMQWebServerConfig extends IRedisSMQRestApiConfig {
|
|
15
|
+
webServer?: {
|
|
16
|
+
port?: number;
|
|
17
|
+
basePath?: string;
|
|
18
|
+
apiProxyTarget?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
10
21
|
export interface IRedisSMQWebServerParsedConfig extends IRedisSMQRestApiParsedConfig {
|
|
11
22
|
webServer: {
|
|
12
23
|
port: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACtE,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAKlB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,MAAM,WAAW,8BACf,SAAQ,4BAA4B;IACpC,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QAKjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
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,7 +9,8 @@ export declare class RedisSMQWebServer {
|
|
|
8
9
|
private restApi;
|
|
9
10
|
private bootstrapped;
|
|
10
11
|
private httpServer;
|
|
11
|
-
|
|
12
|
+
protected logger: ILogger;
|
|
13
|
+
constructor(config?: IRedisSMQWebServerConfig);
|
|
12
14
|
private setupMiddleware;
|
|
13
15
|
private setupApi;
|
|
14
16
|
private setupRoutes;
|
|
@@ -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;AAEvD,iEAA8D;AAC9D,uDAAyD;AAEzD,MAAa,iBAAiB;IAW5B,YAAY,SAAmC,EAAE;;QAVhC,QAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;QAIhB,mBAAc,GAAkB,IAAI,CAAC;QAC9C,YAAO,GAA2B,IAAI,CAAC;QACvC,iBAAY,GAAG,KAAK,CAAC;QACrB,eAAU,GAAuB,IAAI,CAAC;QAK5C,IAAI,CAAC,MAAM,GAAG,IAAA,6BAAW,EAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG;YACjB,SAAS,EAAE,IAAI,CAAC,MAAM,C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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/bin/cli.js
CHANGED
|
@@ -2,19 +2,52 @@
|
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import { RedisSMQWebServer } from '../src/index.js';
|
|
4
4
|
import { defaultConfig } from '../src/config/parse-config.js';
|
|
5
|
+
import { EConsoleLoggerLevel } from 'redis-smq-common';
|
|
6
|
+
import { defaultConfig as defaultRedisSMQConfig } from 'redis-smq';
|
|
7
|
+
const defaultLogLevel = typeof defaultRedisSMQConfig.logger.options.logLevel === 'number'
|
|
8
|
+
? defaultRedisSMQConfig.logger.options.logLevel
|
|
9
|
+
: EConsoleLoggerLevel[defaultRedisSMQConfig.logger.options.logLevel];
|
|
5
10
|
const program = new Command();
|
|
6
11
|
program
|
|
7
12
|
.name('redis-smq-web-server')
|
|
8
13
|
.description('Web server for RedisSMQ Web UI');
|
|
9
14
|
program
|
|
10
|
-
.option('-p, --port <
|
|
11
|
-
.option('-
|
|
12
|
-
.option('-
|
|
13
|
-
.option('-
|
|
14
|
-
.option('-
|
|
15
|
-
.option('-
|
|
15
|
+
.option('-p, --port <number>', 'Port to run the server on', String(defaultConfig.webServer?.port))
|
|
16
|
+
.option('-b, --base-path <string>', 'Base public path for the RedisSMQ Web UI SPA', defaultConfig.webServer?.basePath)
|
|
17
|
+
.option('-t, --api-proxy-target <string>', 'Proxy target for API (/api, /docs, /assets). Example: http://127.0.0.1:6000', defaultConfig.webServer?.apiProxyTarget)
|
|
18
|
+
.option('-c, --redis-client <ioredis|redis>', 'Redis client. Valid options are: ioredis, redis.', defaultRedisSMQConfig.redis.client)
|
|
19
|
+
.option('-r, --redis-host <string>', 'Redis server host', defaultRedisSMQConfig.redis.options.host)
|
|
20
|
+
.option('-o, --redis-port <number>', 'Redis server port', String(defaultRedisSMQConfig.redis.options.port))
|
|
21
|
+
.option('-d, --redis-db <number>', 'Redis database number', String(defaultRedisSMQConfig.redis.options.db))
|
|
22
|
+
.option('-e, --enable-log <0|1>', 'Enable console logging. Valid options are: 0, 1', String(Number(defaultRedisSMQConfig.logger.enabled)))
|
|
23
|
+
.option('-v, --log-level <0|1|2|3>', `Log level. Numbers: ${EConsoleLoggerLevel.DEBUG}=DEBUG, ${EConsoleLoggerLevel.INFO}=INFO, ${EConsoleLoggerLevel.WARN}=WARN, ${EConsoleLoggerLevel.ERROR}=ERROR`, String(defaultLogLevel));
|
|
16
24
|
program.parse();
|
|
17
25
|
const options = program.opts();
|
|
18
|
-
const
|
|
26
|
+
const config = {
|
|
27
|
+
webServer: {
|
|
28
|
+
port: Number(options.port),
|
|
29
|
+
basePath: options.basePath,
|
|
30
|
+
apiProxyTarget: options.apiProxyTarget,
|
|
31
|
+
},
|
|
32
|
+
apiServer: {
|
|
33
|
+
port: Number(options.port),
|
|
34
|
+
basePath: options.basePath,
|
|
35
|
+
},
|
|
36
|
+
redis: {
|
|
37
|
+
client: options.redisClient,
|
|
38
|
+
options: {
|
|
39
|
+
host: options.redisHost,
|
|
40
|
+
port: Number(options.redisPort),
|
|
41
|
+
db: Number(options.redisDb),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
logger: {
|
|
45
|
+
enabled: Boolean(Number(options.enableLog)),
|
|
46
|
+
options: {
|
|
47
|
+
logLevel: Number(options.logLevel),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const server = new RedisSMQWebServer(config);
|
|
19
52
|
server.run();
|
|
20
53
|
//# sourceMappingURL=cli.js.map
|
package/dist/esm/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../bin/cli.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../bin/cli.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKpD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEnE,MAAM,eAAe,GACnB,OAAO,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ;IAC/D,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ;IAC/C,CAAC,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,sBAAsB,CAAC;KAC5B,WAAW,CAAC,gCAAgC,CAAC,CAAC;AAEjD,OAAO;KACJ,MAAM,CACL,qBAAqB,EACrB,2BAA2B,EAC3B,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,CACtC;KACA,MAAM,CACL,0BAA0B,EAC1B,8CAA8C,EAC9C,aAAa,CAAC,SAAS,EAAE,QAAQ,CAClC;KACA,MAAM,CACL,iCAAiC,EACj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E;YACP,IAAI,EAAE,OAAO,CAAC,SAAS;YACvB,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAC/B,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC5B;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,OAAO,EAAE;YACP,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACnC;KACF;CACF,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AASA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"parse-config.d.ts","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AASA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,aAAa,EAAE,wBAM3B,CAAC;AAMF,wBAAgB,WAAW,CACzB,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,8BAA8B,CAgBhC"}
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseConfig as parseRestApiConfig } from 'redis-smq-rest-api';
|
|
2
2
|
export const defaultConfig = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
apiProxyTarget: undefined,
|
|
3
|
+
webServer: {
|
|
4
|
+
port: 8080,
|
|
5
|
+
basePath: '/',
|
|
6
|
+
apiProxyTarget: undefined,
|
|
7
|
+
},
|
|
9
8
|
};
|
|
10
9
|
export function parseConfig(config = {}) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
const webServerCfg = {
|
|
16
|
-
port: cfg.port,
|
|
17
|
-
basePath: cfg.basePath,
|
|
18
|
-
apiProxyTarget: cfg.apiProxyTarget,
|
|
10
|
+
const restApiParsedConfig = parseRestApiConfig(config);
|
|
11
|
+
const webServer = {
|
|
12
|
+
...defaultConfig.webServer,
|
|
13
|
+
...config.webServer,
|
|
19
14
|
};
|
|
20
15
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
webServer: webServerCfg,
|
|
31
|
-
apiServer: {
|
|
32
|
-
port: cfg.port,
|
|
33
|
-
basePath: cfg.basePath,
|
|
16
|
+
...restApiParsedConfig,
|
|
17
|
+
webServer: {
|
|
18
|
+
port: Number(webServer.port),
|
|
19
|
+
basePath: String(webServer.basePath),
|
|
20
|
+
apiProxyTarget: webServer.apiProxyTarget
|
|
21
|
+
? String(webServer.apiProxyTarget)
|
|
22
|
+
: undefined,
|
|
34
23
|
},
|
|
35
24
|
};
|
|
36
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"parse-config.js","sourceRoot":"","sources":["../../../../src/config/parse-config.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,CAAC,MAAM,aAAa,GAA6B;IACrD,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,GAAG;QACb,cAAc,EAAE,SAAS;KAC1B;CACF,CAAC;AAMF,MAAM,UAAU,WAAW,CACzB,SAA4C,EAAE;IAE9C,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG;QAChB,GAAG,aAAa,CAAC,SAAS;QAC1B,GAAG,MAAM,CAAC,SAAS;KACpB,CAAC;IACF,OAAO;QACL,GAAG,mBAAmB;QACtB,SAAS,EAAE;YACT,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YAC5B,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;YACpC,cAAc,EAAE,SAAS,CAAC,cAAc;gBACtC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;gBAClC,CAAC,CAAC,SAAS;SACd;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { IRedisSMQRestApiParsedConfig } from 'redis-smq-rest-api';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IRedisSMQRestApiConfig, IRedisSMQRestApiParsedConfig } from 'redis-smq-rest-api';
|
|
2
|
+
import { EConsoleLoggerLevel, ERedisConfigClient } from 'redis-smq-common';
|
|
3
|
+
export interface IRedisSMQWebServerCliOptions {
|
|
4
|
+
port: string;
|
|
4
5
|
basePath: string;
|
|
5
|
-
|
|
6
|
+
redisClient: ERedisConfigClient;
|
|
7
|
+
redisPort: string;
|
|
6
8
|
redisHost: string;
|
|
7
|
-
|
|
9
|
+
redisDb: string;
|
|
10
|
+
enableLog: string;
|
|
11
|
+
logLevel: EConsoleLoggerLevel;
|
|
8
12
|
apiProxyTarget?: string;
|
|
9
13
|
}
|
|
14
|
+
export interface IRedisSMQWebServerConfig extends IRedisSMQRestApiConfig {
|
|
15
|
+
webServer?: {
|
|
16
|
+
port?: number;
|
|
17
|
+
basePath?: string;
|
|
18
|
+
apiProxyTarget?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
10
21
|
export interface IRedisSMQWebServerParsedConfig extends IRedisSMQRestApiParsedConfig {
|
|
11
22
|
webServer: {
|
|
12
23
|
port: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/types/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACtE,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAKlB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,MAAM,WAAW,8BACf,SAAQ,4BAA4B;IACpC,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QAKjB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
|
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,7 +9,8 @@ export declare class RedisSMQWebServer {
|
|
|
8
9
|
private restApi;
|
|
9
10
|
private bootstrapped;
|
|
10
11
|
private httpServer;
|
|
11
|
-
|
|
12
|
+
protected logger: ILogger;
|
|
13
|
+
constructor(config?: IRedisSMQWebServerConfig);
|
|
12
14
|
private setupMiddleware;
|
|
13
15
|
private setupApi;
|
|
14
16
|
private setupRoutes;
|
|
@@ -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,oB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,EAAE,CAAC,CAAC;YACtE,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;YAC7D,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+BAA+B,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,KAAK,CAAC,QAAQ;QAEnB,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YACjD,MAAM,IAAI,OAAO,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.4",
|
|
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",
|
|
@@ -37,16 +37,26 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"commander": "13.1.0",
|
|
39
39
|
"express": "4.21.2",
|
|
40
|
-
"http-proxy-middleware": "3.0.5"
|
|
41
|
-
"ioredis": "5.5.0"
|
|
40
|
+
"http-proxy-middleware": "3.0.5"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@types/express": "4.17.23"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
47
|
-
"redis
|
|
48
|
-
"
|
|
49
|
-
"redis-smq
|
|
46
|
+
"@redis/client": "^1.6.0",
|
|
47
|
+
"ioredis": "^5.4.0",
|
|
48
|
+
"redis-smq": "^9.0.0-next.4",
|
|
49
|
+
"redis-smq-common": "^9.0.0-next.4",
|
|
50
|
+
"redis-smq-rest-api": "^9.0.0-next.4",
|
|
51
|
+
"redis-smq-web-ui": "^9.0.0-next.4"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@redis/client": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"ioredis": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
50
60
|
},
|
|
51
61
|
"engineStrict": true,
|
|
52
62
|
"engines": {
|