@serve.zone/dcrouter 34.6.0 → 34.7.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.
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.dcrouter.d.ts +7 -0
- package/dist_ts/classes.dcrouter.js +5 -4
- package/dist_ts/email/classes.coremail-gateway.manager.d.ts +23 -9
- package/dist_ts/email/classes.coremail-gateway.manager.js +55 -14
- package/dist_ts/email/coremail-gateway-runtime.d.ts +5 -2
- package/dist_ts/email/coremail-gateway-runtime.js +14 -10
- package/dist_ts/opsserver/classes.coremail-gateway-server.d.ts +35 -0
- package/dist_ts/opsserver/classes.coremail-gateway-server.js +91 -0
- package/dist_ts/opsserver/classes.opsserver.d.ts +5 -2
- package/dist_ts/opsserver/classes.opsserver.js +14 -3
- package/dist_ts/plugins.d.ts +3 -0
- package/dist_ts/plugins.js +8 -1
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/package.json +5 -1
- package/readme.md +19 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.dcrouter.ts +12 -3
- package/ts/email/classes.coremail-gateway.manager.ts +102 -37
- package/ts/email/coremail-gateway-runtime.ts +21 -14
- package/ts/opsserver/classes.coremail-gateway-server.ts +104 -0
- package/ts/opsserver/classes.opsserver.ts +16 -2
- package/ts/plugins.ts +12 -0
- package/ts_web/00_commitinfo_data.ts +1 -1
|
@@ -8,6 +8,7 @@ import * as interfaces from '../../ts_interfaces/index.js';
|
|
|
8
8
|
import { McpManager } from './classes.mcpmanager.js';
|
|
9
9
|
import { createLogStreamAuthorizationAdapter } from './helpers/logstream-auth.js';
|
|
10
10
|
import { WorkloadMailServer } from './classes.workload-mail-server.js';
|
|
11
|
+
import { CoreMailGatewayServer } from './classes.coremail-gateway-server.js';
|
|
11
12
|
import type { IListeningSocket } from '../config/helpers.listeners.js';
|
|
12
13
|
|
|
13
14
|
export class OpsServer {
|
|
@@ -58,6 +59,8 @@ export class OpsServer {
|
|
|
58
59
|
// Detach the edges start() adds to the dcRouter's main typedrouter, which outlives this server.
|
|
59
60
|
private dcRouterEdgeDisposers: Array<() => void> = [];
|
|
60
61
|
private workloadMailServer?: WorkloadMailServer;
|
|
62
|
+
/** The CoreMail gateway listener (wire 9) while it runs; absent unless configured. */
|
|
63
|
+
public coreMailGatewayServer?: CoreMailGatewayServer;
|
|
61
64
|
/** The port the Ops server listens on from its completed start until its stop begins. */
|
|
62
65
|
private listeningPort?: number;
|
|
63
66
|
|
|
@@ -67,8 +70,8 @@ export class OpsServer {
|
|
|
67
70
|
|
|
68
71
|
/**
|
|
69
72
|
* The Ops server's socket once its start completed: typedserver binds every address (`0.0.0.0`)
|
|
70
|
-
* and refuses `start()` on an address another socket holds. The workload mail
|
|
71
|
-
* 127.0.0.1 only and
|
|
73
|
+
* and refuses `start()` on an address another socket holds. The workload mail and CoreMail
|
|
74
|
+
* gateway listeners bind 127.0.0.1 only and are never public, so they are not listed.
|
|
72
75
|
*/
|
|
73
76
|
public getListeningSockets(): IListeningSocket[] {
|
|
74
77
|
return this.listeningPort === undefined
|
|
@@ -107,6 +110,13 @@ export class OpsServer {
|
|
|
107
110
|
);
|
|
108
111
|
await this.workloadMailServer.start();
|
|
109
112
|
}
|
|
113
|
+
if (this.dcRouterRef.options.coreMailGatewayServer) {
|
|
114
|
+
this.coreMailGatewayServer = new CoreMailGatewayServer(
|
|
115
|
+
this.dcRouterRef.options.coreMailGatewayServer,
|
|
116
|
+
this.dcRouterRef.coreMailGatewayManager,
|
|
117
|
+
);
|
|
118
|
+
await this.coreMailGatewayServer.start();
|
|
119
|
+
}
|
|
110
120
|
} catch (startError) {
|
|
111
121
|
// Nobody stops a server whose start failed (ServiceManager rolls back only the services that
|
|
112
122
|
// started), so undo this start here and keep its error first.
|
|
@@ -241,6 +251,10 @@ export class OpsServer {
|
|
|
241
251
|
await this.workloadMailServer?.stop();
|
|
242
252
|
this.workloadMailServer = undefined;
|
|
243
253
|
}),
|
|
254
|
+
attempt(async () => {
|
|
255
|
+
await this.coreMailGatewayServer?.stop();
|
|
256
|
+
this.coreMailGatewayServer = undefined;
|
|
257
|
+
}),
|
|
244
258
|
attempt(() => this.server?.stop()),
|
|
245
259
|
attempt(() => this.logsHandler?.cleanup()),
|
|
246
260
|
]);
|
package/ts/plugins.ts
CHANGED
|
@@ -55,6 +55,18 @@ export {
|
|
|
55
55
|
typedsocket,
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
// The CoreMail gateway listener's wire (Linus ruling 70, L1 and L2): TypedServer 16 with its
|
|
59
|
+
// TypedSocket 10 (wire major 9) and the TypedRequest 9 copy that TypedServer resolves, under aliases
|
|
60
|
+
// only `CoreMailGatewayServer` and the gateway handlers it serves use. Everything else stays on the
|
|
61
|
+
// TypedSocket 8 packages above.
|
|
62
|
+
import * as typedrequestCoreMail from '@api.global/typedrequest-coremail';
|
|
63
|
+
import * as typedserverCoreMail from '@api.global/typedserver-coremail';
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
typedrequestCoreMail,
|
|
67
|
+
typedserverCoreMail,
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
// @idp.global scope
|
|
59
71
|
import * as idpSdkServer from '@idp.global/sdk/server';
|
|
60
72
|
|