itlab-internal-services 2.4.4 → 2.4.6
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/modules/mail/index.d.ts +0 -1
- package/dist/modules/mail/index.js +1 -4
- package/dist/modules/mail/mail.service.d.ts +4 -22
- package/dist/modules/mail/mail.service.js +8 -37
- package/package.json +3 -2
- package/dist/modules/mail/mail.models.d.ts +0 -28
- package/dist/modules/mail/mail.models.js +0 -61
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MailService = exports.MailModule =
|
|
4
|
-
var mail_models_1 = require("./mail.models");
|
|
5
|
-
Object.defineProperty(exports, "MailDagoBERTDowntime", { enumerable: true, get: function () { return mail_models_1.MailDagoBERTDowntime; } });
|
|
6
|
-
Object.defineProperty(exports, "MailWeeklyDagoBERTSummary", { enumerable: true, get: function () { return mail_models_1.MailWeeklyDagoBERTSummary; } });
|
|
3
|
+
exports.MailService = exports.MailModule = void 0;
|
|
7
4
|
var mail_module_1 = require("./mail.module");
|
|
8
5
|
Object.defineProperty(exports, "MailModule", { enumerable: true, get: function () { return mail_module_1.MailModule; } });
|
|
9
6
|
var mail_service_1 = require("./mail.service");
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ConfigService } from '@nestjs/config';
|
|
2
|
-
import { MailDagoBERTDowntime, MailWeeklyDagoBERTSummary } from './mail.models';
|
|
3
2
|
/**
|
|
4
3
|
* Mail service
|
|
5
4
|
* @class MailService
|
|
@@ -16,27 +15,10 @@ export declare class MailService {
|
|
|
16
15
|
/** The axios instance */
|
|
17
16
|
private axios;
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* Send data to a specified address.
|
|
20
19
|
*
|
|
21
|
-
* @param {string}
|
|
22
|
-
* @param {
|
|
23
|
-
* @return {void}
|
|
20
|
+
* @param {string} endpoint - the endpoint of the mail service
|
|
21
|
+
* @param {Data} data - the data to sent
|
|
24
22
|
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Sends the weekly DagoBERT summary via email.
|
|
28
|
-
*
|
|
29
|
-
* @param {MailWeeklyDagoBERTSummary} data - the data for the weekly summary
|
|
30
|
-
* @param {string} address - the email address to send the summary to
|
|
31
|
-
* @return {void}
|
|
32
|
-
*/
|
|
33
|
-
sendWeeklyDagoBERTSummary(data: MailWeeklyDagoBERTSummary, address: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Send DagoBERT downtime data to the specified address.
|
|
36
|
-
*
|
|
37
|
-
* @param {MailDagoBERTDowntime} data - the data to send
|
|
38
|
-
* @param {string} address - the address to send the data to
|
|
39
|
-
* @return {void}
|
|
40
|
-
*/
|
|
41
|
-
sendDagoBERTDowntime(data: MailDagoBERTDowntime, address: string): void;
|
|
23
|
+
send<T>(endpoint: string, data: T): void;
|
|
42
24
|
}
|
|
@@ -35,46 +35,17 @@ let MailService = MailService_1 = class MailService {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Send data to a specified address.
|
|
39
39
|
*
|
|
40
|
-
* @param {string}
|
|
41
|
-
* @param {
|
|
42
|
-
* @return {void}
|
|
40
|
+
* @param {string} endpoint - the endpoint of the mail service
|
|
41
|
+
* @param {Data} data - the data to sent
|
|
43
42
|
*/
|
|
44
|
-
|
|
45
|
-
this.logger.log(
|
|
43
|
+
send(endpoint, data) {
|
|
44
|
+
this.logger.log(`Sending E-Mail using endpoint ${endpoint}`);
|
|
46
45
|
this.axios
|
|
47
|
-
.post(
|
|
48
|
-
.then(() => this.logger.log('
|
|
49
|
-
.catch(({ response }) => this.logger.error("Couldn't send
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Sends the weekly DagoBERT summary via email.
|
|
53
|
-
*
|
|
54
|
-
* @param {MailWeeklyDagoBERTSummary} data - the data for the weekly summary
|
|
55
|
-
* @param {string} address - the email address to send the summary to
|
|
56
|
-
* @return {void}
|
|
57
|
-
*/
|
|
58
|
-
sendWeeklyDagoBERTSummary(data, address) {
|
|
59
|
-
this.logger.log('Sending weekly DagoBERT summary');
|
|
60
|
-
this.axios
|
|
61
|
-
.post(`weekly-dagobert-summary`, Object.assign(Object.assign({}, data), { address }))
|
|
62
|
-
.then(() => this.logger.log('Weekly DagoBERT summary sent'))
|
|
63
|
-
.catch(({ response }) => this.logger.error("Couldnt't send weekly DagoBERT summary...", response.data));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Send DagoBERT downtime data to the specified address.
|
|
67
|
-
*
|
|
68
|
-
* @param {MailDagoBERTDowntime} data - the data to send
|
|
69
|
-
* @param {string} address - the address to send the data to
|
|
70
|
-
* @return {void}
|
|
71
|
-
*/
|
|
72
|
-
sendDagoBERTDowntime(data, address) {
|
|
73
|
-
this.logger.log('Sending DagoBERT downtime');
|
|
74
|
-
this.axios
|
|
75
|
-
.post(`dagobert-downtime`, Object.assign(Object.assign({}, data), { address }))
|
|
76
|
-
.then(() => this.logger.log('DagoBERT downtime sent'))
|
|
77
|
-
.catch(({ response }) => this.logger.error("Couldnt't send DagoBERT downtime...", response.data));
|
|
46
|
+
.post(endpoint, data)
|
|
47
|
+
.then(() => this.logger.log('E-Mail sent'))
|
|
48
|
+
.catch(({ response }) => this.logger.error("Couldn't send E-Mail...", response.data));
|
|
78
49
|
}
|
|
79
50
|
};
|
|
80
51
|
MailService = MailService_1 = __decorate([
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "timo.scheuermann@sv-informatik.de",
|
|
6
6
|
"url": "https://timos.design"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.4.
|
|
8
|
+
"version": "2.4.6",
|
|
9
9
|
"type": "commonjs",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
@@ -70,5 +70,6 @@
|
|
|
70
70
|
},
|
|
71
71
|
"lint-staged": {
|
|
72
72
|
"**/*.{ts,json}": []
|
|
73
|
-
}
|
|
73
|
+
},
|
|
74
|
+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
|
74
75
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a MailWeeklyDagoBERTSummary
|
|
3
|
-
*/
|
|
4
|
-
export declare class MailWeeklyDagoBERTSummary {
|
|
5
|
-
/** The timespan */
|
|
6
|
-
timespan: string;
|
|
7
|
-
/** The total number of analyzed logs */
|
|
8
|
-
total: string;
|
|
9
|
-
/** The total number of anomalies */
|
|
10
|
-
anomalies: string;
|
|
11
|
-
/** The total number of downtimes */
|
|
12
|
-
downtimes: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Represents a MailDagoBERTDowntime
|
|
16
|
-
*/
|
|
17
|
-
export declare class MailDagoBERTDowntime {
|
|
18
|
-
/** The name of the application */
|
|
19
|
-
app: string;
|
|
20
|
-
/** The namespace of the application */
|
|
21
|
-
namespace: string;
|
|
22
|
-
/** The duration */
|
|
23
|
-
duration: string;
|
|
24
|
-
/** The start time */
|
|
25
|
-
start: string;
|
|
26
|
-
/** The end time */
|
|
27
|
-
end: string;
|
|
28
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.MailDagoBERTDowntime = exports.MailWeeklyDagoBERTSummary = void 0;
|
|
13
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
-
/**
|
|
15
|
-
* Represents a MailWeeklyDagoBERTSummary
|
|
16
|
-
*/
|
|
17
|
-
class MailWeeklyDagoBERTSummary {
|
|
18
|
-
}
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, swagger_1.ApiProperty)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], MailWeeklyDagoBERTSummary.prototype, "timespan", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, swagger_1.ApiProperty)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], MailWeeklyDagoBERTSummary.prototype, "total", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, swagger_1.ApiProperty)(),
|
|
29
|
-
__metadata("design:type", String)
|
|
30
|
-
], MailWeeklyDagoBERTSummary.prototype, "anomalies", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, swagger_1.ApiProperty)(),
|
|
33
|
-
__metadata("design:type", String)
|
|
34
|
-
], MailWeeklyDagoBERTSummary.prototype, "downtimes", void 0);
|
|
35
|
-
exports.MailWeeklyDagoBERTSummary = MailWeeklyDagoBERTSummary;
|
|
36
|
-
/**
|
|
37
|
-
* Represents a MailDagoBERTDowntime
|
|
38
|
-
*/
|
|
39
|
-
class MailDagoBERTDowntime {
|
|
40
|
-
}
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, swagger_1.ApiProperty)(),
|
|
43
|
-
__metadata("design:type", String)
|
|
44
|
-
], MailDagoBERTDowntime.prototype, "app", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, swagger_1.ApiProperty)(),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], MailDagoBERTDowntime.prototype, "namespace", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, swagger_1.ApiProperty)(),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], MailDagoBERTDowntime.prototype, "duration", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, swagger_1.ApiProperty)(),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], MailDagoBERTDowntime.prototype, "start", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, swagger_1.ApiProperty)(),
|
|
59
|
-
__metadata("design:type", String)
|
|
60
|
-
], MailDagoBERTDowntime.prototype, "end", void 0);
|
|
61
|
-
exports.MailDagoBERTDowntime = MailDagoBERTDowntime;
|