itlab-internal-services 2.4.5 → 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.
@@ -1,3 +1,2 @@
1
- export { MailDagoBERTDowntime, MailWeeklyDagoBERTSummary } from './mail.models';
2
1
  export { MailModule } from './mail.module';
3
2
  export { MailService } from './mail.service';
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MailService = exports.MailModule = exports.MailWeeklyDagoBERTSummary = exports.MailDagoBERTDowntime = void 0;
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,12 +1,4 @@
1
1
  import { ConfigService } from '@nestjs/config';
2
- import { MailDagoBERTDowntime, MailPasswordReset, MailToken, MailWeeklyDagoBERTSummary } from './mail.models';
3
- declare type Data = MailToken | MailPasswordReset | MailWeeklyDagoBERTSummary | MailDagoBERTDowntime | Record<string, string>;
4
- export declare enum Endpoint {
5
- Token = "token",
6
- PasswordReset = "password-reset",
7
- WeeklyDagoBERTSummary = "weekly-dagobert-summary",
8
- DagoBERTDowntime = "dagobert-downtime"
9
- }
10
2
  /**
11
3
  * Mail service
12
4
  * @class MailService
@@ -27,8 +19,6 @@ export declare class MailService {
27
19
  *
28
20
  * @param {string} endpoint - the endpoint of the mail service
29
21
  * @param {Data} data - the data to sent
30
- * @param address - the addess where the data will be sent to
31
22
  */
32
- send<T = Data>(endpoint: string, data: T, address: string): void;
23
+ send<T>(endpoint: string, data: T): void;
33
24
  }
34
- export {};
@@ -10,18 +10,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  var MailService_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.MailService = exports.Endpoint = void 0;
13
+ exports.MailService = void 0;
14
14
  const common_1 = require("@nestjs/common");
15
15
  const config_1 = require("@nestjs/config");
16
16
  const axios_1 = require("../../axios");
17
17
  const env_1 = require("../../env");
18
- var Endpoint;
19
- (function (Endpoint) {
20
- Endpoint["Token"] = "token";
21
- Endpoint["PasswordReset"] = "password-reset";
22
- Endpoint["WeeklyDagoBERTSummary"] = "weekly-dagobert-summary";
23
- Endpoint["DagoBERTDowntime"] = "dagobert-downtime";
24
- })(Endpoint = exports.Endpoint || (exports.Endpoint = {}));
25
18
  /**
26
19
  * Mail service
27
20
  * @class MailService
@@ -46,12 +39,11 @@ let MailService = MailService_1 = class MailService {
46
39
  *
47
40
  * @param {string} endpoint - the endpoint of the mail service
48
41
  * @param {Data} data - the data to sent
49
- * @param address - the addess where the data will be sent to
50
42
  */
51
- send(endpoint, data, address) {
52
- this.logger.log('Sending E-Mail');
43
+ send(endpoint, data) {
44
+ this.logger.log(`Sending E-Mail using endpoint ${endpoint}`);
53
45
  this.axios
54
- .post(endpoint, Object.assign(Object.assign({}, data), { address }))
46
+ .post(endpoint, data)
55
47
  .then(() => this.logger.log('E-Mail sent'))
56
48
  .catch(({ response }) => this.logger.error("Couldn't send E-Mail...", response.data));
57
49
  }
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.5",
8
+ "version": "2.4.6",
9
9
  "type": "commonjs",
10
10
  "files": [
11
11
  "dist"
@@ -1,44 +0,0 @@
1
- /**
2
- * Represents a MailToken
3
- */
4
- export declare class MailToken {
5
- /** The login token */
6
- token: string;
7
- }
8
- /**
9
- * Represents a MailWeeklyDagoBERTSummary
10
- */
11
- export declare class MailWeeklyDagoBERTSummary {
12
- /** The timespan */
13
- timespan: string;
14
- /** The total number of analyzed logs */
15
- total: string;
16
- /** The total number of anomalies */
17
- anomalies: string;
18
- /** The total number of downtimes */
19
- downtimes: string;
20
- }
21
- /**
22
- * Represents a MailDagoBERTDowntime
23
- */
24
- export declare class MailDagoBERTDowntime {
25
- /** The name of the application */
26
- app: string;
27
- /** The namespace of the application */
28
- namespace: string;
29
- /** The duration */
30
- duration: string;
31
- /** The start time */
32
- start: string;
33
- /** The end time */
34
- end: string;
35
- }
36
- /**
37
- * Represents a MailPasswordReset
38
- */
39
- export declare class MailPasswordReset {
40
- /** The name of the receiver */
41
- name: string;
42
- /** The URL from where to reset the password from */
43
- url: string;
44
- }
@@ -1,81 +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.MailPasswordReset = exports.MailDagoBERTDowntime = exports.MailWeeklyDagoBERTSummary = exports.MailToken = void 0;
13
- const swagger_1 = require("@nestjs/swagger");
14
- /**
15
- * Represents a MailToken
16
- */
17
- class MailToken {
18
- }
19
- exports.MailToken = MailToken;
20
- /**
21
- * Represents a MailWeeklyDagoBERTSummary
22
- */
23
- class MailWeeklyDagoBERTSummary {
24
- }
25
- __decorate([
26
- (0, swagger_1.ApiProperty)(),
27
- __metadata("design:type", String)
28
- ], MailWeeklyDagoBERTSummary.prototype, "timespan", void 0);
29
- __decorate([
30
- (0, swagger_1.ApiProperty)(),
31
- __metadata("design:type", String)
32
- ], MailWeeklyDagoBERTSummary.prototype, "total", void 0);
33
- __decorate([
34
- (0, swagger_1.ApiProperty)(),
35
- __metadata("design:type", String)
36
- ], MailWeeklyDagoBERTSummary.prototype, "anomalies", void 0);
37
- __decorate([
38
- (0, swagger_1.ApiProperty)(),
39
- __metadata("design:type", String)
40
- ], MailWeeklyDagoBERTSummary.prototype, "downtimes", void 0);
41
- exports.MailWeeklyDagoBERTSummary = MailWeeklyDagoBERTSummary;
42
- /**
43
- * Represents a MailDagoBERTDowntime
44
- */
45
- class MailDagoBERTDowntime {
46
- }
47
- __decorate([
48
- (0, swagger_1.ApiProperty)(),
49
- __metadata("design:type", String)
50
- ], MailDagoBERTDowntime.prototype, "app", void 0);
51
- __decorate([
52
- (0, swagger_1.ApiProperty)(),
53
- __metadata("design:type", String)
54
- ], MailDagoBERTDowntime.prototype, "namespace", void 0);
55
- __decorate([
56
- (0, swagger_1.ApiProperty)(),
57
- __metadata("design:type", String)
58
- ], MailDagoBERTDowntime.prototype, "duration", void 0);
59
- __decorate([
60
- (0, swagger_1.ApiProperty)(),
61
- __metadata("design:type", String)
62
- ], MailDagoBERTDowntime.prototype, "start", void 0);
63
- __decorate([
64
- (0, swagger_1.ApiProperty)(),
65
- __metadata("design:type", String)
66
- ], MailDagoBERTDowntime.prototype, "end", void 0);
67
- exports.MailDagoBERTDowntime = MailDagoBERTDowntime;
68
- /**
69
- * Represents a MailPasswordReset
70
- */
71
- class MailPasswordReset {
72
- }
73
- __decorate([
74
- (0, swagger_1.ApiProperty)(),
75
- __metadata("design:type", String)
76
- ], MailPasswordReset.prototype, "name", void 0);
77
- __decorate([
78
- (0, swagger_1.ApiProperty)(),
79
- __metadata("design:type", String)
80
- ], MailPasswordReset.prototype, "url", void 0);
81
- exports.MailPasswordReset = MailPasswordReset;