@tstdl/base 0.82.6 → 0.82.8
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/api/client/client.js +2 -1
- package/api/client/client.js.map +1 -1
- package/api/types.d.ts +3 -3
- package/authentication/authentication.api.d.ts +98 -14
- package/authentication/authentication.api.js +31 -27
- package/authentication/authentication.api.js.map +1 -1
- package/authentication/client/api.client.d.ts +50 -0
- package/authentication/client/api.client.js +27 -0
- package/authentication/client/api.client.js.map +1 -0
- package/authentication/client/authentication.service.d.ts +39 -0
- package/authentication/client/authentication.service.js +176 -0
- package/authentication/client/authentication.service.js.map +1 -0
- package/authentication/client/index.d.ts +4 -0
- package/authentication/client/index.js +21 -0
- package/authentication/client/index.js.map +1 -0
- package/authentication/client/module.d.ts +8 -0
- package/authentication/client/module.js +16 -0
- package/authentication/client/module.js.map +1 -0
- package/authentication/client/tokens.d.ts +4 -0
- package/authentication/client/tokens.js +7 -0
- package/authentication/client/tokens.js.map +1 -0
- package/authentication/index.d.ts +2 -0
- package/authentication/index.js +19 -0
- package/authentication/index.js.map +1 -0
- package/authentication/models/authentication-session.model.d.ts +0 -2
- package/authentication/models/authentication-session.model.js +0 -10
- package/authentication/models/authentication-session.model.js.map +1 -1
- package/authentication/models/index.d.ts +1 -0
- package/authentication/models/index.js +1 -0
- package/authentication/models/index.js.map +1 -1
- package/authentication/models/token-payload-base.model.d.ts +7 -0
- package/authentication/models/token-payload-base.model.js +19 -0
- package/authentication/models/token-payload-base.model.js.map +1 -1
- package/authentication/models/token.model.d.ts +16 -0
- package/authentication/models/token.model.js +3 -0
- package/authentication/models/token.model.js.map +1 -0
- package/authentication/{authentication-credentials.repository.d.ts → server/authentication-credentials.repository.d.ts} +2 -2
- package/authentication/{authentication-credentials.repository.js → server/authentication-credentials.repository.js} +1 -1
- package/authentication/server/authentication-credentials.repository.js.map +1 -0
- package/authentication/{authentication-session.repository.d.ts → server/authentication-session.repository.d.ts} +2 -3
- package/authentication/{authentication-session.repository.js → server/authentication-session.repository.js} +0 -0
- package/authentication/server/authentication-session.repository.js.map +1 -0
- package/authentication/server/authentication-token-payload.provider.d.ts +3 -0
- package/authentication/{authentication-token-payload.provider.js → server/authentication-token-payload.provider.js} +1 -1
- package/authentication/server/authentication-token-payload.provider.js.map +1 -0
- package/authentication/server/authentication.api-controller.d.ts +13 -0
- package/authentication/server/authentication.api-controller.js +65 -0
- package/authentication/server/authentication.api-controller.js.map +1 -0
- package/authentication/{authentication.service.d.ts → server/authentication.service.d.ts} +23 -11
- package/authentication/{authentication.service.js → server/authentication.service.js} +92 -47
- package/authentication/server/authentication.service.js.map +1 -0
- package/authentication/server/helper.d.ts +13 -0
- package/authentication/server/helper.js +62 -0
- package/authentication/server/helper.js.map +1 -0
- package/authentication/server/index.d.ts +8 -0
- package/authentication/server/index.js +25 -0
- package/authentication/server/index.js.map +1 -0
- package/authentication/server/module.d.ts +12 -0
- package/authentication/server/module.js +19 -0
- package/authentication/server/module.js.map +1 -0
- package/authentication/server/mongo/index.d.ts +2 -0
- package/authentication/server/mongo/index.js +19 -0
- package/authentication/server/mongo/index.js.map +1 -0
- package/authentication/{mongo → server/mongo}/mongo-authentication-credentials.repository.d.ts +15 -18
- package/authentication/{mongo → server/mongo}/mongo-authentication-credentials.repository.js +36 -27
- package/authentication/server/mongo/mongo-authentication-credentials.repository.js.map +1 -0
- package/authentication/{mongo → server/mongo}/mongo-authentication-session.repository.d.ts +12 -15
- package/authentication/{mongo → server/mongo}/mongo-authentication-session.repository.js +27 -22
- package/authentication/server/mongo/mongo-authentication-session.repository.js.map +1 -0
- package/authentication/{tokens.d.ts → server/tokens.d.ts} +1 -1
- package/authentication/{tokens.js → server/tokens.js} +1 -1
- package/authentication/server/tokens.js.map +1 -0
- package/container/token.d.ts +2 -2
- package/container/types.d.ts +2 -1
- package/cookie/cookie.d.ts +14 -0
- package/cookie/cookie.js +58 -0
- package/cookie/cookie.js.map +1 -0
- package/cookie/index.d.ts +1 -0
- package/cookie/index.js +18 -0
- package/cookie/index.js.map +1 -0
- package/examples/api/authentication.d.ts +1 -0
- package/examples/api/authentication.js +51 -0
- package/examples/api/authentication.js.map +1 -0
- package/examples/api/basic-overview.js +4 -4
- package/examples/api/basic-overview.js.map +1 -1
- package/examples/api/custom-authentication.d.ts +1 -0
- package/examples/api/custom-authentication.js +89 -0
- package/examples/api/custom-authentication.js.map +1 -0
- package/examples/api/streaming.js +10 -8
- package/examples/api/streaming.js.map +1 -1
- package/http/cookie-parser.d.ts +1 -3
- package/http/cookie-parser.js +10 -19
- package/http/cookie-parser.js.map +1 -1
- package/http/http-headers.d.ts +2 -2
- package/http/http-headers.js +11 -11
- package/http/http-headers.js.map +1 -1
- package/http/http-value-map.js +13 -13
- package/http/http-value-map.js.map +1 -1
- package/http/server/http-server-response.d.ts +8 -3
- package/http/server/http-server-response.js +8 -0
- package/http/server/http-server-response.js.map +1 -1
- package/http/server/node/module.d.ts +2 -2
- package/http/server/node/module.js +3 -5
- package/http/server/node/module.js.map +1 -1
- package/mail/clients/nodemailer.mail-client.js +1 -1
- package/mail/clients/nodemailer.mail-client.js.map +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.d.ts +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.js +21 -2
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.js.map +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.d.ts +4 -4
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js +27 -4
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js.map +1 -1
- package/message-bus/broadcast-channel/index.d.ts +1 -0
- package/message-bus/broadcast-channel/index.js +1 -0
- package/message-bus/broadcast-channel/index.js.map +1 -1
- package/message-bus/broadcast-channel/module.d.ts +4 -0
- package/message-bus/broadcast-channel/module.js +17 -0
- package/message-bus/broadcast-channel/module.js.map +1 -0
- package/message-bus/local/index.d.ts +1 -0
- package/message-bus/local/index.js +1 -0
- package/message-bus/local/index.js.map +1 -1
- package/message-bus/local/local-message-bus-provider.d.ts +0 -5
- package/message-bus/local/local-message-bus-provider.js +1 -13
- package/message-bus/local/local-message-bus-provider.js.map +1 -1
- package/message-bus/local/local-message-bus.d.ts +1 -1
- package/message-bus/local/local-message-bus.js +2 -2
- package/message-bus/local/local-message-bus.js.map +1 -1
- package/message-bus/local/module.d.ts +4 -0
- package/message-bus/local/module.js +17 -0
- package/message-bus/local/module.js.map +1 -0
- package/message-bus/message-bus-base.d.ts +1 -1
- package/message-bus/message-bus-base.js +1 -1
- package/message-bus/message-bus-base.js.map +1 -1
- package/message-bus/message-bus.d.ts +1 -0
- package/message-bus/message-bus.js +3 -0
- package/message-bus/message-bus.js.map +1 -1
- package/notification/notification.service.js +2 -2
- package/notification/notification.service.js.map +1 -1
- package/object-storage/s3/s3.object.js +3 -3
- package/object-storage/s3/s3.object.js.map +1 -1
- package/package.json +4 -4
- package/schema/schemas/assign.js +2 -0
- package/schema/schemas/assign.js.map +1 -1
- package/schema/schemas/object.d.ts +1 -0
- package/schema/schemas/object.js +2 -1
- package/schema/schemas/object.js.map +1 -1
- package/schema/types/types.d.ts +1 -1
- package/schema/utils/schema.js.map +1 -1
- package/utils/array/array.js +2 -2
- package/utils/array/array.js.map +1 -1
- package/utils/string/index.d.ts +1 -0
- package/utils/string/index.js +1 -0
- package/utils/string/index.js.map +1 -1
- package/utils/string/title-case.d.ts +1 -0
- package/utils/string/title-case.js +13 -0
- package/utils/string/title-case.js.map +1 -0
- package/utils/type-guards.d.ts +1 -1
- package/utils/type-guards.js.map +1 -1
- package/utils/type-of.d.ts +1 -1
- package/utils/type-of.js +3 -4
- package/utils/type-of.js.map +1 -1
- package/authentication/authentication-credentials.repository.js.map +0 -1
- package/authentication/authentication-session.repository.js.map +0 -1
- package/authentication/authentication-token-payload.provider.d.ts +0 -3
- package/authentication/authentication-token-payload.provider.js.map +0 -1
- package/authentication/authentication.service.js.map +0 -1
- package/authentication/mongo/mongo-authentication-credentials.repository.js.map +0 -1
- package/authentication/mongo/mongo-authentication-session.repository.js.map +0 -1
- package/authentication/tokens.js.map +0 -1
package/http/http-headers.js
CHANGED
|
@@ -7,37 +7,37 @@ const type_guards_1 = require("../utils/type-guards");
|
|
|
7
7
|
const http_value_map_1 = require("./http-value-map");
|
|
8
8
|
class HttpHeaders extends http_value_map_1.HttpValueMap {
|
|
9
9
|
get accept() {
|
|
10
|
-
return this.
|
|
10
|
+
return this.tryGetStringHeader('Accept');
|
|
11
11
|
}
|
|
12
12
|
set accept(value) {
|
|
13
13
|
this.set('Accept', value);
|
|
14
14
|
}
|
|
15
15
|
get contentType() {
|
|
16
|
-
return this.
|
|
16
|
+
return this.tryGetStringHeader('Content-Type');
|
|
17
17
|
}
|
|
18
18
|
set contentType(value) {
|
|
19
19
|
this.set('Content-Type', value);
|
|
20
20
|
}
|
|
21
21
|
get contentLength() {
|
|
22
|
-
return this.
|
|
22
|
+
return this.tryGetNumberHeader('Content-Length');
|
|
23
23
|
}
|
|
24
24
|
set contentLength(value) {
|
|
25
25
|
this.set('Content-Length', value);
|
|
26
26
|
}
|
|
27
27
|
get contentDisposition() {
|
|
28
|
-
return this.
|
|
28
|
+
return this.tryGetStringHeader('Content-Disposition');
|
|
29
29
|
}
|
|
30
30
|
set contentDisposition(value) {
|
|
31
31
|
this.set('Content-Disposition', value);
|
|
32
32
|
}
|
|
33
33
|
get contentEncoding() {
|
|
34
|
-
return this.
|
|
34
|
+
return this.tryGetStringHeader('Content-Encoding');
|
|
35
35
|
}
|
|
36
36
|
set contentEncoding(value) {
|
|
37
37
|
this.set('Content-Encoding', value);
|
|
38
38
|
}
|
|
39
39
|
get authorization() {
|
|
40
|
-
return this.
|
|
40
|
+
return this.tryGetStringHeader('Authorization');
|
|
41
41
|
}
|
|
42
42
|
set authorization(value) {
|
|
43
43
|
this.set('Authorization', value);
|
|
@@ -57,7 +57,7 @@ class HttpHeaders extends http_value_map_1.HttpValueMap {
|
|
|
57
57
|
clone() {
|
|
58
58
|
return new HttpHeaders(this);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
tryGetNumberHeader(name) {
|
|
61
61
|
const value = this.tryGet(name);
|
|
62
62
|
if ((0, type_guards_1.isNullOrUndefined)(value)) {
|
|
63
63
|
return undefined;
|
|
@@ -68,22 +68,22 @@ class HttpHeaders extends http_value_map_1.HttpValueMap {
|
|
|
68
68
|
if ((0, type_guards_1.isString)(value) && patterns_1.numberPattern.test(value)) {
|
|
69
69
|
const numberValue = Number(value);
|
|
70
70
|
if (Number.isNaN(numberValue)) {
|
|
71
|
-
throw new bad_request_error_1.BadRequestError(`
|
|
71
|
+
throw new bad_request_error_1.BadRequestError(`Invalid ${name} header.`);
|
|
72
72
|
}
|
|
73
73
|
return numberValue;
|
|
74
74
|
}
|
|
75
75
|
if ((0, type_guards_1.isNotNumber)(value)) {
|
|
76
|
-
throw new bad_request_error_1.BadRequestError(`
|
|
76
|
+
throw new bad_request_error_1.BadRequestError(`Invalid ${name} header.`);
|
|
77
77
|
}
|
|
78
78
|
return value;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
tryGetStringHeader(name) {
|
|
81
81
|
const value = this.tryGet(name);
|
|
82
82
|
if ((0, type_guards_1.isNullOrUndefined)(value)) {
|
|
83
83
|
return undefined;
|
|
84
84
|
}
|
|
85
85
|
if ((0, type_guards_1.isNotString)(value)) {
|
|
86
|
-
throw new bad_request_error_1.BadRequestError(`
|
|
86
|
+
throw new bad_request_error_1.BadRequestError(`Invalid ${name} header.`);
|
|
87
87
|
}
|
|
88
88
|
return value;
|
|
89
89
|
}
|
package/http/http-headers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-headers.js","sourceRoot":"","sources":["../../source/http/http-headers.ts"],"names":[],"mappings":";;;AAAA,kEAA4D;AAC5D,gDAAiD;AACjD,sDAAmH;AAEnH,qDAAgD;AAShD,MAAa,WAAY,SAAQ,6BAAyB;IACxD,IAAI,MAA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CAAC;aACtD;YAED,OAAO,WAAW,CAAC;SACpB;QAED,IAAI,IAAA,yBAAW,EAAC,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,mCAAe,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC;SACtD;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,kBAAkB,CAAC,IAAY;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEhC,IAAI,IAAA,+BAAiB,EAAC,KAAK,CAAC,EAAE;YAC5B,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,IAAA,yBAAW,EAAC,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,mCAAe,CAAC,WAAW,IAAI,UAAU,CAAC,CAAC;SACtD;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9GD,kCA8GC"}
|
package/http/http-value-map.js
CHANGED
|
@@ -25,11 +25,11 @@ class HttpValueMap {
|
|
|
25
25
|
}
|
|
26
26
|
/** get value. Throws if entry not set */
|
|
27
27
|
get(key) {
|
|
28
|
-
const
|
|
29
|
-
if (!this.has(
|
|
30
|
-
throw new bad_request_error_1.BadRequestError(`Missing ${
|
|
28
|
+
const normalizedKey = this.normalizeKey(key);
|
|
29
|
+
if (!this.has(normalizedKey)) {
|
|
30
|
+
throw new bad_request_error_1.BadRequestError(`Missing ${normalizedKey} ${this.valueType}`);
|
|
31
31
|
}
|
|
32
|
-
return this.map.get(
|
|
32
|
+
return this.map.get(normalizedKey).value;
|
|
33
33
|
}
|
|
34
34
|
/** try to get value */
|
|
35
35
|
tryGet(key) {
|
|
@@ -37,19 +37,19 @@ class HttpValueMap {
|
|
|
37
37
|
}
|
|
38
38
|
/** get single value, throws if multiple values are set */
|
|
39
39
|
getSingle(key) {
|
|
40
|
-
const
|
|
41
|
-
const value = this.tryGetSingle(
|
|
40
|
+
const normalizedKey = this.normalizeKey(key);
|
|
41
|
+
const value = this.tryGetSingle(normalizedKey);
|
|
42
42
|
if ((0, type_guards_1.isUndefined)(value)) {
|
|
43
|
-
throw new bad_request_error_1.BadRequestError(`Missing ${
|
|
43
|
+
throw new bad_request_error_1.BadRequestError(`Missing ${normalizedKey} ${this.valueType}`);
|
|
44
44
|
}
|
|
45
45
|
return value;
|
|
46
46
|
}
|
|
47
47
|
/** try to get single value, throws if multiple values are set */
|
|
48
48
|
tryGetSingle(key) {
|
|
49
|
-
const
|
|
50
|
-
const value = this.map.get(
|
|
49
|
+
const normalizedKey = this.normalizeKey(key);
|
|
50
|
+
const value = this.map.get(normalizedKey)?.value;
|
|
51
51
|
if ((0, type_guards_1.isArray)(value)) {
|
|
52
|
-
throw new bad_request_error_1.BadRequestError(`Invalid ${
|
|
52
|
+
throw new bad_request_error_1.BadRequestError(`Invalid ${normalizedKey} ${this.valueType}. Expected single value.`);
|
|
53
53
|
}
|
|
54
54
|
return value;
|
|
55
55
|
}
|
|
@@ -77,10 +77,10 @@ class HttpValueMap {
|
|
|
77
77
|
}
|
|
78
78
|
/** add value to existing entry or create new entry */
|
|
79
79
|
append(key, value) {
|
|
80
|
-
const
|
|
81
|
-
const existing = this.tryGet(
|
|
80
|
+
const normalizedKey = this.normalizeKey(key);
|
|
81
|
+
const existing = this.tryGet(normalizedKey);
|
|
82
82
|
const newValue = (0, type_guards_1.isUndefined)(existing) ? value : [...(0, array_1.toArray)(existing), ...(0, array_1.toArray)(value)];
|
|
83
|
-
this.set(
|
|
83
|
+
this.set(normalizedKey, newValue);
|
|
84
84
|
}
|
|
85
85
|
/** remove entry */
|
|
86
86
|
remove(key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-value-map.js","sourceRoot":"","sources":["../../source/http/http-value-map.ts"],"names":[],"mappings":";;;AAAA,kEAA4D;AAE5D,0CAAwC;AACxC,uEAAkE;AAClE,mDAAsD;AACtD,sDAAsE;AAEtE,mCAAmE;AAInE,MAAsB,YAAY;IACf,SAAS,CAAS;IAClB,eAAe,CAAU;IACzB,G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|
+
import type { Record } from "../../types";
|
|
3
4
|
import type { HttpHeadersInput } from '../http-headers';
|
|
4
5
|
import { HttpHeaders } from '../http-headers';
|
|
6
|
+
export type SetCookieObject = SetCookieOptions & {
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
5
9
|
export type HttpServerResponseOptions = {
|
|
6
10
|
statusCode?: number | undefined;
|
|
7
11
|
statusMessage?: string | undefined;
|
|
8
12
|
headers?: HttpHeadersInput | HttpHeaders;
|
|
13
|
+
cookies?: Record<string, SetCookieObject>;
|
|
9
14
|
body?: {
|
|
10
15
|
stream?: ReadableStream<Uint8Array>;
|
|
11
16
|
buffer?: Uint8Array;
|
|
12
17
|
text?: string;
|
|
13
|
-
json?:
|
|
18
|
+
json?: unknown;
|
|
14
19
|
events?: SeverSentEvents;
|
|
15
20
|
};
|
|
16
21
|
};
|
|
@@ -22,7 +27,7 @@ export declare class HttpServerResponse {
|
|
|
22
27
|
stream?: ReadableStream<Uint8Array>;
|
|
23
28
|
buffer?: Uint8Array;
|
|
24
29
|
text?: string;
|
|
25
|
-
json?:
|
|
30
|
+
json?: unknown;
|
|
26
31
|
events?: SeverSentEvents;
|
|
27
32
|
};
|
|
28
33
|
constructor(response?: HttpServerResponseOptions);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpServerResponse = void 0;
|
|
4
|
+
const cookie_1 = require("../../cookie/cookie");
|
|
5
|
+
const object_1 = require("../../utils/object/object");
|
|
6
|
+
const type_guards_1 = require("../../utils/type-guards");
|
|
4
7
|
const http_headers_1 = require("../http-headers");
|
|
5
8
|
class HttpServerResponse {
|
|
6
9
|
statusCode;
|
|
@@ -12,6 +15,11 @@ class HttpServerResponse {
|
|
|
12
15
|
this.statusMessage = response.statusMessage;
|
|
13
16
|
this.headers = new http_headers_1.HttpHeaders(response.headers);
|
|
14
17
|
this.body = response.body;
|
|
18
|
+
if ((0, type_guards_1.isDefined)(response.cookies)) {
|
|
19
|
+
for (const [name, options] of (0, object_1.objectEntries)(response.cookies)) {
|
|
20
|
+
this.headers.append('Set-Cookie', (0, cookie_1.formatSetCookie)(name, options.value, options));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
static fromObject(options) {
|
|
17
25
|
return new HttpServerResponse(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server-response.js","sourceRoot":"","sources":["../../../source/http/server/http-server-response.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"http-server-response.js","sourceRoot":"","sources":["../../../source/http/server/http-server-response.ts"],"names":[],"mappings":";;;AACA,gDAAkD;AAGlD,sDAAsD;AACtD,yDAAgD;AAEhD,kDAA8C;AAoB9C,MAAa,kBAAkB;IAC7B,UAAU,CAAqB;IAC/B,aAAa,CAAqB;IAClC,OAAO,CAAc;IACrB,IAAI,CAMF;IAEF,YAAY,WAAsC,EAAE;QAClD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,0BAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAE1B,IAAI,IAAA,uBAAS,EAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC/B,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAA,sBAAa,EAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAC7D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,IAAA,wBAAe,EAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;aAClF;SACF;IACH,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAmC;QACnD,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF;AA5BD,gDA4BC"}
|
|
@@ -5,12 +5,10 @@ const container_1 = require("../../../container");
|
|
|
5
5
|
const http_server_1 = require("../http-server");
|
|
6
6
|
const node_http_server_1 = require("./node-http-server");
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* registers {@link HttpServer} in global container
|
|
9
9
|
*/
|
|
10
|
-
function configureNodeHttpServer(
|
|
11
|
-
|
|
12
|
-
container_1.container.register(http_server_1.HttpServer, { useToken: node_http_server_1.NodeHttpServer });
|
|
13
|
-
}
|
|
10
|
+
function configureNodeHttpServer() {
|
|
11
|
+
container_1.container.registerSingleton(http_server_1.HttpServer, { useToken: node_http_server_1.NodeHttpServer });
|
|
14
12
|
}
|
|
15
13
|
exports.configureNodeHttpServer = configureNodeHttpServer;
|
|
16
14
|
//# sourceMappingURL=module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../source/http/server/node/module.ts"],"names":[],"mappings":";;;AAAA,kDAAwC;AACxC,gDAA4C;AAC5C,yDAAoD;AAEpD;;GAEG;AACH,SAAgB,uBAAuB
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../source/http/server/node/module.ts"],"names":[],"mappings":";;;AAAA,kDAAwC;AACxC,gDAA4C;AAC5C,yDAAoD;AAEpD;;GAEG;AACH,SAAgB,uBAAuB;IACrC,qBAAS,CAAC,iBAAiB,CAAC,wBAAU,EAAE,EAAE,QAAQ,EAAE,iCAAc,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,0DAEC"}
|
|
@@ -72,7 +72,7 @@ function convertConfig(config) {
|
|
|
72
72
|
*/
|
|
73
73
|
function configureNodemailerMailClient(register = true) {
|
|
74
74
|
if (register) {
|
|
75
|
-
container_1.container.
|
|
75
|
+
container_1.container.registerSingleton(NodemailerMailClient, { useToken: mail_client_1.MailClient });
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
exports.configureNodemailerMailClient = configureNodemailerMailClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodemailer.mail-client.js","sourceRoot":"","sources":["../../../source/mail/clients/nodemailer.mail-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AAEtE,yDAAkD;AAElD,2CAA6C;AAC7C,gDAA8D;AAE9D,sCAA+C;AAIxC,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wBAAU;IACjC,WAAW,CAA6C;IAEzE,YAAqD,MAAwB;QAC3E,KAAK,EAAE,CAAC;QAER,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,IAAA,4BAAe,EAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,IAAc;QACvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,EAAE,EAAE,IAAI,CAAC,EAAoC;YAC7C,EAAE,EAAE,IAAI,CAAC,EAAoC;YAC7C,GAAG,EAAE,IAAI,CAAC,GAAqC;YAC/C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,UAAU,EAAE,IAAI,CAAC,UAAuC;YACxD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QAEH,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,E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AAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YAC3C,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;YACtB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ;SAC3B;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,6BAA6B,CAAC,WAAoB,IAAI;IACpE,IAAI,QAAQ,EAAE;QACZ,qBAAS,CAAC,iBAAiB,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,wBAAU,EAAE,CAAC,CAAC;KAC7E;AACH,CAAC;AAJD,sEAIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Logger } from "../../logger";
|
|
2
2
|
import type { MessageBus } from '../message-bus';
|
|
3
3
|
import type { MessageBusProvider } from '../message-bus-provider';
|
|
4
4
|
export declare class BroadcastChannelMessageBusProvider implements MessageBusProvider {
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.BroadcastChannelMessageBusProvider = void 0;
|
|
16
|
+
const container_1 = require("../../container");
|
|
17
|
+
const logger_1 = require("../../logger");
|
|
4
18
|
const broadcast_channel_message_bus_1 = require("./broadcast-channel-message-bus");
|
|
5
|
-
class BroadcastChannelMessageBusProvider {
|
|
19
|
+
let BroadcastChannelMessageBusProvider = class BroadcastChannelMessageBusProvider {
|
|
6
20
|
logger;
|
|
7
21
|
constructor(logger) {
|
|
8
22
|
this.logger = logger;
|
|
@@ -10,6 +24,11 @@ class BroadcastChannelMessageBusProvider {
|
|
|
10
24
|
get(channel) {
|
|
11
25
|
return new broadcast_channel_message_bus_1.BroadcastChannelMessageBus(() => new BroadcastChannel(channel), this.logger);
|
|
12
26
|
}
|
|
13
|
-
}
|
|
27
|
+
};
|
|
28
|
+
BroadcastChannelMessageBusProvider = __decorate([
|
|
29
|
+
(0, container_1.injectable)(),
|
|
30
|
+
__param(0, (0, container_1.resolveArg)('BroadcastChannelMessageBusProvider')),
|
|
31
|
+
__metadata("design:paramtypes", [logger_1.Logger])
|
|
32
|
+
], BroadcastChannelMessageBusProvider);
|
|
14
33
|
exports.BroadcastChannelMessageBusProvider = BroadcastChannelMessageBusProvider;
|
|
15
34
|
//# sourceMappingURL=broadcast-channel-message-bus-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast-channel-message-bus-provider.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"broadcast-channel-message-bus-provider.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAqD;AAErD,yCAAkC;AAGlC,mFAA6E;AAGtE,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC5B,MAAM,CAAS;IAEhC,YAA8E,MAAc;QAC1F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,GAAG,CAAI,OAAe;QACpB,OAAO,IAAI,0DAA0B,CAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1F,CAAC;CACF,CAAA;AAVY,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;IAIE,WAAA,IAAA,sBAAU,EAAiB,oCAAoC,CAAC,CAAA;qCAAS,eAAM;GAHjF,kCAAkC,CAU9C;AAVY,gFAAkC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Logger } from "../../logger";
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
3
|
import type { MessageBus } from '../message-bus';
|
|
4
4
|
import { MessageBusBase } from '../message-bus-base';
|
|
5
5
|
/** return values wrapped in Promise for polyfills which returns promises */
|
|
6
6
|
interface PromisifiedBroadcastChannel extends BroadcastChannel {
|
|
7
|
-
close(...args: Parameters<BroadcastChannel['close']>): Promise<
|
|
8
|
-
postMessage(...args: Parameters<BroadcastChannel['postMessage']>): Promise<
|
|
7
|
+
close(...args: Parameters<BroadcastChannel['close']>): void | Promise<void>;
|
|
8
|
+
postMessage(...args: Parameters<BroadcastChannel['postMessage']>): void | Promise<void>;
|
|
9
9
|
}
|
|
10
10
|
export declare class BroadcastChannelMessageBus<T> extends MessageBusBase<T> implements MessageBus<T> {
|
|
11
11
|
private readonly channelProvider;
|
|
@@ -14,6 +14,6 @@ export declare class BroadcastChannelMessageBus<T> extends MessageBusBase<T> imp
|
|
|
14
14
|
get channel(): PromisifiedBroadcastChannel;
|
|
15
15
|
constructor(channelProvider: () => BroadcastChannel, logger: Logger);
|
|
16
16
|
protected _publish(message: T): Promise<void>;
|
|
17
|
-
protected
|
|
17
|
+
protected _dispose(): Promise<void>;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.BroadcastChannelMessageBus = void 0;
|
|
4
|
-
const
|
|
13
|
+
const container_1 = require("../../container");
|
|
14
|
+
const logger_1 = require("../../logger");
|
|
5
15
|
const type_guards_1 = require("../../utils/type-guards");
|
|
16
|
+
const rxjs_1 = require("rxjs");
|
|
6
17
|
const message_bus_base_1 = require("../message-bus-base");
|
|
7
|
-
|
|
18
|
+
const broadcast_channel_message_bus_provider_1 = require("./broadcast-channel-message-bus-provider");
|
|
19
|
+
let BroadcastChannelMessageBus = class BroadcastChannelMessageBus extends message_bus_base_1.MessageBusBase {
|
|
8
20
|
channelProvider;
|
|
9
21
|
_channel;
|
|
10
22
|
_messages$;
|
|
@@ -25,10 +37,21 @@ class BroadcastChannelMessageBus extends message_bus_base_1.MessageBusBase {
|
|
|
25
37
|
async _publish(message) {
|
|
26
38
|
await this.channel.postMessage(message);
|
|
27
39
|
}
|
|
28
|
-
async
|
|
40
|
+
async _dispose() {
|
|
29
41
|
await this._channel?.close();
|
|
30
42
|
this._channel = undefined;
|
|
31
43
|
}
|
|
32
|
-
}
|
|
44
|
+
};
|
|
45
|
+
BroadcastChannelMessageBus = __decorate([
|
|
46
|
+
(0, container_1.injectable)({
|
|
47
|
+
provider: {
|
|
48
|
+
useFactory: (argument, context) => {
|
|
49
|
+
const channel = (0, type_guards_1.assertStringPass)(argument, 'LocalMessageBus resolve argument must be a string (channel)');
|
|
50
|
+
return context.resolve(broadcast_channel_message_bus_provider_1.BroadcastChannelMessageBusProvider).get(channel);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:paramtypes", [Function, logger_1.Logger])
|
|
55
|
+
], BroadcastChannelMessageBus);
|
|
33
56
|
exports.BroadcastChannelMessageBus = BroadcastChannelMessageBus;
|
|
34
57
|
//# sourceMappingURL=broadcast-channel-message-bus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broadcast-channel-message-bus.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/broadcast-channel-message-bus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"broadcast-channel-message-bus.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/broadcast-channel-message-bus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAyC;AACzC,yCAAkC;AAClC,yDAAoE;AAEpE,+BAA4D;AAE5D,0DAAqD;AACrD,qGAA8F;AAgBvF,IAAM,0BAA0B,GAAhC,MAAM,0BAA8B,SAAQ,iCAAiB;IACjD,eAAe,CAAoC;IAE5D,QAAQ,CAA0C;IAEvC,UAAU,CAAgB;IAE7C,IAAI,OAAO;QACT,IAAI,IAAA,yBAAW,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;gBAC3B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;aAC5C;YAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC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true });
|
|
17
17
|
__exportStar(require("./broadcast-channel-message-bus"), exports);
|
|
18
18
|
__exportStar(require("./broadcast-channel-message-bus-provider"), exports);
|
|
19
|
+
__exportStar(require("./module"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,2EAAyD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,2EAAyD;AACzD,2CAAyB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureBroadcastChannelMessageBus = void 0;
|
|
4
|
+
const container_1 = require("../../container");
|
|
5
|
+
const message_bus_1 = require("../message-bus");
|
|
6
|
+
const message_bus_provider_1 = require("../message-bus-provider");
|
|
7
|
+
const broadcast_channel_message_bus_1 = require("./broadcast-channel-message-bus");
|
|
8
|
+
const broadcast_channel_message_bus_provider_1 = require("./broadcast-channel-message-bus-provider");
|
|
9
|
+
/**
|
|
10
|
+
* registers {@link BroadcastChannelMessageBus} and {@link BroadcastChannelMessageBusProvider} in global container
|
|
11
|
+
*/
|
|
12
|
+
function configureBroadcastChannelMessageBus() {
|
|
13
|
+
container_1.container.register(message_bus_1.MessageBus, { useToken: broadcast_channel_message_bus_1.BroadcastChannelMessageBus });
|
|
14
|
+
container_1.container.registerSingleton(message_bus_provider_1.MessageBusProvider, { useToken: broadcast_channel_message_bus_provider_1.BroadcastChannelMessageBusProvider });
|
|
15
|
+
}
|
|
16
|
+
exports.configureBroadcastChannelMessageBus = configureBroadcastChannelMessageBus;
|
|
17
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../source/message-bus/broadcast-channel/module.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,gDAA4C;AAC5C,kEAA6D;AAC7D,mFAA6E;AAC7E,qGAA8F;AAE9F;;GAEG;AACH,SAAgB,mCAAmC;IACjD,qBAAS,CAAC,QAAQ,CAAC,wBAAU,EAAE,EAAE,QAAQ,EAAE,0DAA0B,EAAE,CAAC,CAAC;IACzE,qBAAS,CAAC,iBAAiB,CAAC,yCAAkB,EAAE,EAAE,QAAQ,EAAE,2EAAkC,EAAE,CAAC,CAAC;AACpG,CAAC;AAHD,kFAGC"}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./local-message-bus"), exports);
|
|
18
18
|
__exportStar(require("./local-message-bus-provider"), exports);
|
|
19
|
+
__exportStar(require("./module"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/message-bus/local/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+DAA6C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/message-bus/local/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,+DAA6C;AAC7C,2CAAyB"}
|
|
@@ -7,8 +7,3 @@ export declare class LocalMessageBusProvider extends MessageBusProvider {
|
|
|
7
7
|
constructor(logger: Logger);
|
|
8
8
|
get<T>(channel: string): LocalMessageBus<T>;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* configure local message bus module
|
|
12
|
-
* @param register whether to register for {@link LocalMessageBus} and {@link LocalMessageBusProvider}
|
|
13
|
-
*/
|
|
14
|
-
export declare function configureLocalMessageBus(register?: boolean): void;
|
|
@@ -12,14 +12,13 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.LocalMessageBusProvider = void 0;
|
|
16
16
|
const container_1 = require("../../container");
|
|
17
17
|
const weak_ref_map_1 = require("../../data-structures/weak-ref-map");
|
|
18
18
|
const logger_1 = require("../../logger");
|
|
19
19
|
const factory_map_1 = require("../../utils/factory-map");
|
|
20
20
|
const type_guards_1 = require("../../utils/type-guards");
|
|
21
21
|
const rxjs_1 = require("rxjs");
|
|
22
|
-
const message_bus_1 = require("../message-bus");
|
|
23
22
|
const message_bus_provider_1 = require("../message-bus-provider");
|
|
24
23
|
const local_message_bus_1 = require("./local-message-bus");
|
|
25
24
|
let LocalMessageBusProvider = class LocalMessageBusProvider extends message_bus_provider_1.MessageBusProvider {
|
|
@@ -45,15 +44,4 @@ LocalMessageBusProvider = __decorate([
|
|
|
45
44
|
__metadata("design:paramtypes", [logger_1.Logger])
|
|
46
45
|
], LocalMessageBusProvider);
|
|
47
46
|
exports.LocalMessageBusProvider = LocalMessageBusProvider;
|
|
48
|
-
/**
|
|
49
|
-
* configure local message bus module
|
|
50
|
-
* @param register whether to register for {@link LocalMessageBus} and {@link LocalMessageBusProvider}
|
|
51
|
-
*/
|
|
52
|
-
function configureLocalMessageBus(register = true) {
|
|
53
|
-
if (register) {
|
|
54
|
-
container_1.container.registerSingleton(message_bus_provider_1.MessageBusProvider, { useToken: LocalMessageBusProvider });
|
|
55
|
-
container_1.container.register(message_bus_1.MessageBus, { useToken: local_message_bus_1.LocalMessageBus });
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.configureLocalMessageBus = configureLocalMessageBus;
|
|
59
47
|
//# sourceMappingURL=local-message-bus-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-message-bus-provider.js","sourceRoot":"","sources":["../../../source/message-bus/local/local-message-bus-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"local-message-bus-provider.js","sourceRoot":"","sources":["../../../source/message-bus/local/local-message-bus-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qEAA4D;AAE5D,yCAAkC;AAClC,yDAAiD;AACjD,yDAAkD;AAClD,+BAA+B;AAC/B,kEAA6D;AAC7D,2DAAsD;AAI/C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,yCAAkB;IAC5C,MAAM,CAAS;IACf,kBAAkB,CAAwD;IAE3F,YAA2D,MAAc;QACvE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,kBAAkB,GAAG,IAAI,wBAAU,CAAuC,GAAG,EAAE,CAAC,IAAI,cAAO,EAAE,EAAE,yBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,yBAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3J,CAAC;IAED,GAAG,CAAI,OAAe;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,IAAA,yBAAW,EAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SAC1B;QAED,OAAO,IAAI,mCAAe,CAAI,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;CACF,CAAA;AArBY,uBAAuB;IADnC,IAAA,qBAAS,GAAE;IAKG,WAAA,IAAA,sBAAU,EAAiB,iBAAiB,CAAC,CAAA;qCAAS,eAAM;GAJ9D,uBAAuB,CAqBnC;AArBY,0DAAuB"}
|
|
@@ -10,5 +10,5 @@ export declare class LocalMessageBus<T> extends MessageBusBase<T> implements Mes
|
|
|
10
10
|
protected _messages$: Observable<T>;
|
|
11
11
|
constructor(subject: Subject<LocalMessageBusItem<T>>, logger: Logger);
|
|
12
12
|
_publish(message: T): void;
|
|
13
|
-
|
|
13
|
+
_dispose(): void;
|
|
14
14
|
}
|
|
@@ -29,8 +29,8 @@ let LocalMessageBus = class LocalMessageBus extends message_bus_base_1.MessageBu
|
|
|
29
29
|
_publish(message) {
|
|
30
30
|
this.subject.next({ source: this.source, message });
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
_dispose() {
|
|
33
|
+
this.subject.complete();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
LocalMessageBus = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-message-bus.js","sourceRoot":"","sources":["../../../source/message-bus/local/local-message-bus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAyC;AACzC,yCAAkC;AAClC,yDAAuD;AAEvD,+BAA4C;AAE5C,0DAAqD;AACrD,6EAAuE;AAWhE,IAAM,eAAe,GAArB,MAAM,eAAmB,SAAQ,iCAAiB;IACtC,OAAO,CAAkC;IACzC,MAAM,CAAS;IAEtB,UAAU,CAAgB;IAEpC,YAAY,OAAwC,EAAE,MAAc;QAClE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;QAE/C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAC5B,IAAA,aAAM,EAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAC5C,IAAA,UAAG,EAAC,CAAC,IAAI,EAAE,EAAE,CAAC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U,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;gBAChC,MAAM,OAAO,GAAG,IAAA,8BAAgB,EAAC,QAAQ,EAAE,6DAA6D,CAAC,CAAC;gBAC1G,OAAO,OAAO,CAAC,OAAO,CAAC,oDAAuB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC;SACF;KACF,CAAC;qCAOqB,cAAO,EAAkC,eAAM;GANzD,eAAe,CAyB3B;AAzBY,0CAAe"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configureLocalMessageBus = void 0;
|
|
4
|
+
const container_1 = require("../../container");
|
|
5
|
+
const message_bus_1 = require("../message-bus");
|
|
6
|
+
const message_bus_provider_1 = require("../message-bus-provider");
|
|
7
|
+
const local_message_bus_1 = require("./local-message-bus");
|
|
8
|
+
const local_message_bus_provider_1 = require("./local-message-bus-provider");
|
|
9
|
+
/**
|
|
10
|
+
* registers {@link LocalMessageBus} and {@link LocalMessageBusProvider} in global container
|
|
11
|
+
*/
|
|
12
|
+
function configureLocalMessageBus() {
|
|
13
|
+
container_1.container.register(message_bus_1.MessageBus, { useToken: local_message_bus_1.LocalMessageBus });
|
|
14
|
+
container_1.container.registerSingleton(message_bus_provider_1.MessageBusProvider, { useToken: local_message_bus_provider_1.LocalMessageBusProvider });
|
|
15
|
+
}
|
|
16
|
+
exports.configureLocalMessageBus = configureLocalMessageBus;
|
|
17
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../source/message-bus/local/module.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,gDAA4C;AAC5C,kEAA6D;AAC7D,2DAAsD;AACtD,6EAAuE;AAEvE;;GAEG;AACH,SAAgB,wBAAwB;IACtC,qBAAS,CAAC,QAAQ,CAAC,wBAAU,EAAE,EAAE,QAAQ,EAAE,mCAAe,EAAE,CAAC,CAAC;IAC9D,qBAAS,CAAC,iBAAiB,CAAC,yCAAkB,EAAE,EAAE,QAAQ,EAAE,oDAAuB,EAAE,CAAC,CAAC;AACzF,CAAC;AAHD,4DAGC"}
|
|
@@ -23,5 +23,5 @@ export declare abstract class MessageBusBase<T> extends MessageBus<T> {
|
|
|
23
23
|
* @param message message to send to other instances
|
|
24
24
|
*/
|
|
25
25
|
protected abstract _publish(message: T): void | Promise<void>;
|
|
26
|
-
protected abstract
|
|
26
|
+
protected abstract _dispose(): void | Promise<void>;
|
|
27
27
|
}
|