itlab-internal-services 2.16.18 → 2.16.20
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/classes/document/commentable-document.class.d.ts +3 -199
- package/dist/classes/document/content-document.class.d.ts +3 -199
- package/dist/classes/document/likeable-document.class.d.ts +2 -205
- package/dist/classes/document/timestamps-document.class.d.ts +4 -200
- package/dist/classes/document/viewable-document.class.d.ts +2 -205
- package/dist/modules/services/base-http.service.js +17 -19
- package/dist/modules/services/providers/mail/dtos/{event-cancel-mail.dto.v1.d.ts → event-user-cancellation-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{event-invite-mail.dto.v1.d.ts → event-user-registration-mail.dto.v1.d.ts} +7 -3
- package/dist/modules/services/providers/mail/dtos/index.d.ts +4 -4
- package/dist/modules/services/providers/mail/dtos/index.js +4 -4
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-cancel-mail.dto.v1.d.ts → lunch-roulette-cancellation-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-submitted-mail.dto.v1.d.ts → lunch-roulette-registration-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/mail-types.d.ts +6 -6
- package/dist/modules/services/providers/mail/mail-types.js +8 -8
- package/dist/modules/services/providers/mail/mail.service.d.ts +9 -9
- package/dist/modules/services/providers/mail/mail.service.js +12 -12
- package/dist/modules/services/providers/mail/models/index.d.ts +1 -0
- package/dist/modules/services/providers/mail/models/index.js +1 -0
- package/dist/modules/services/providers/mail/models/mail-attachment.model.d.ts +36 -0
- package/dist/modules/services/providers/mail/models/mail-attachment.model.js +38 -0
- package/dist/modules/services/providers/mail/models/mail-recipient.model.d.ts +2 -2
- package/dist/modules/services/providers/mail/models/mail-recipient.model.js +2 -2
- package/dist/pipes/queries/mongo-ids.pipe.js +9 -4
- package/dist/transform/mongo-ids.transform.js +5 -2
- package/dist/transform/string-array.transform.js +10 -3
- package/package.json +1 -1
- /package/dist/modules/services/providers/mail/dtos/{event-cancel-mail.dto.v1.js → event-user-cancellation-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/mail/dtos/{event-invite-mail.dto.v1.js → event-user-registration-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/mail/dtos/{lunch-roulette-cancel-mail.dto.v1.js → lunch-roulette-cancellation-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/mail/dtos/{lunch-roulette-submitted-mail.dto.v1.js → lunch-roulette-registration-mail.dto.v1.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfigService } from '@nestjs/config';
|
|
2
2
|
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
3
3
|
import { BaseHttpService } from '../../base-http.service';
|
|
4
|
-
import { AccountLoginTokenMailDtoV1, AccountPasswordResetMailDtoV1,
|
|
4
|
+
import { AccountLoginTokenMailDtoV1, AccountPasswordResetMailDtoV1, EventUserCancellationMailDtoV1, EventUserRegistrationMailDtoV1, IdeaStatusUpdateMailDtoV1, IdeaSubmittedMailDtoV1, LunchRouletteCancellationMailDtoV1, LunchRouletteMatchedMailDtoV1, LunchRouletteRegistrationMailDtoV1, LunchRouletteUnmatchedMailDtoV1, NewsletterIssueMailDtoV1, NewsletterSubscribedMailDtoV1, NewsletterUnsubscribedMailDtoV1, NotificationMailDtoV1 } from './dtos';
|
|
5
5
|
/**
|
|
6
6
|
* MailService
|
|
7
7
|
*
|
|
@@ -37,14 +37,14 @@ export declare class MailService extends BaseHttpService {
|
|
|
37
37
|
sendAccountPasswordResetMailV1(payload: AccountPasswordResetMailDtoV1): void;
|
|
38
38
|
/**
|
|
39
39
|
* Sends an event invitation email.
|
|
40
|
-
* @param {
|
|
40
|
+
* @param {EventUserRegistrationMailDtoV1} payload - DTO containing event details and recipient.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
sendEventUserRegistrationMailV1(payload: EventUserRegistrationMailDtoV1): void;
|
|
43
43
|
/**
|
|
44
44
|
* Sends a notification about an event cancellation.
|
|
45
|
-
* @param {
|
|
45
|
+
* @param {EventUserCancellationMailDtoV1} payload - DTO containing event title, time, and links.
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
sendEventUserCancellationMailV1(payload: EventUserCancellationMailDtoV1): void;
|
|
48
48
|
/**
|
|
49
49
|
* Sends a confirmation that an idea was submitted.
|
|
50
50
|
* @param {IdeaSubmittedMailDtoV1} payload - DTO containing recipient and management URL.
|
|
@@ -57,14 +57,14 @@ export declare class MailService extends BaseHttpService {
|
|
|
57
57
|
sendIdeaStatusUpdateMailV1(payload: IdeaStatusUpdateMailDtoV1): void;
|
|
58
58
|
/**
|
|
59
59
|
* Sends confirmation of lunch roulette participation.
|
|
60
|
-
* @param {
|
|
60
|
+
* @param {LunchRouletteRegistrationMailDtoV1} payload - DTO with recipient, location, and type.
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
sendLunchRouletteRegistrationMailV1(payload: LunchRouletteRegistrationMailDtoV1): void;
|
|
63
63
|
/**
|
|
64
64
|
* Sends a cancellation email for lunch roulette.
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {LunchRouletteCancellationMailDtoV1} payload - DTO containing the recipient.
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
sendLunchRouletteCancellationMailV1(payload: LunchRouletteCancellationMailDtoV1): void;
|
|
68
68
|
/**
|
|
69
69
|
* Sends a match notification to lunch roulette participants.
|
|
70
70
|
* @param {LunchRouletteMatchedMailDtoV1} payload - DTO with recipients, message, and details URL.
|
|
@@ -77,17 +77,17 @@ let MailService = class MailService extends base_http_service_1.BaseHttpService
|
|
|
77
77
|
// ─────────────────────────────────────────────
|
|
78
78
|
/**
|
|
79
79
|
* Sends an event invitation email.
|
|
80
|
-
* @param {
|
|
80
|
+
* @param {EventUserRegistrationMailDtoV1} payload - DTO containing event details and recipient.
|
|
81
81
|
*/
|
|
82
|
-
|
|
83
|
-
this.sendMail('v1.event.
|
|
82
|
+
sendEventUserRegistrationMailV1(payload) {
|
|
83
|
+
this.sendMail('v1.event.user-registration', payload);
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Sends a notification about an event cancellation.
|
|
87
|
-
* @param {
|
|
87
|
+
* @param {EventUserCancellationMailDtoV1} payload - DTO containing event title, time, and links.
|
|
88
88
|
*/
|
|
89
|
-
|
|
90
|
-
this.sendMail('v1.event.
|
|
89
|
+
sendEventUserCancellationMailV1(payload) {
|
|
90
|
+
this.sendMail('v1.event.user-cancellation', payload);
|
|
91
91
|
}
|
|
92
92
|
// ─────────────────────────────────────────────
|
|
93
93
|
// Idea Submission Emails
|
|
@@ -111,17 +111,17 @@ let MailService = class MailService extends base_http_service_1.BaseHttpService
|
|
|
111
111
|
// ─────────────────────────────────────────────
|
|
112
112
|
/**
|
|
113
113
|
* Sends confirmation of lunch roulette participation.
|
|
114
|
-
* @param {
|
|
114
|
+
* @param {LunchRouletteRegistrationMailDtoV1} payload - DTO with recipient, location, and type.
|
|
115
115
|
*/
|
|
116
|
-
|
|
117
|
-
this.sendMail('v1.lunch-roulette.
|
|
116
|
+
sendLunchRouletteRegistrationMailV1(payload) {
|
|
117
|
+
this.sendMail('v1.lunch-roulette.registration', payload);
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
* Sends a cancellation email for lunch roulette.
|
|
121
|
-
* @param {
|
|
121
|
+
* @param {LunchRouletteCancellationMailDtoV1} payload - DTO containing the recipient.
|
|
122
122
|
*/
|
|
123
|
-
|
|
124
|
-
this.sendMail('v1.lunch-roulette.
|
|
123
|
+
sendLunchRouletteCancellationMailV1(payload) {
|
|
124
|
+
this.sendMail('v1.lunch-roulette.cancellation', payload);
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Sends a match notification to lunch roulette participants.
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./mail-attachment.model"), exports);
|
|
17
18
|
__exportStar(require("./mail-recipient.model"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WithImplicitCoercion } from 'buffer';
|
|
2
|
+
type MailAttachmentData = {
|
|
3
|
+
/**
|
|
4
|
+
* The name of the attachment
|
|
5
|
+
*/
|
|
6
|
+
name: string;
|
|
7
|
+
/**
|
|
8
|
+
* The content type of the attachment
|
|
9
|
+
*/
|
|
10
|
+
contentType: string;
|
|
11
|
+
/**
|
|
12
|
+
* The content of the attachment
|
|
13
|
+
*/
|
|
14
|
+
content: WithImplicitCoercion<ArrayLike<number> | string>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* MailAttachment class
|
|
18
|
+
* @class MailAttachment
|
|
19
|
+
* @description Represents an attachment, which can be sent with an email
|
|
20
|
+
*/
|
|
21
|
+
export declare class MailAttachment {
|
|
22
|
+
constructor(data: MailAttachmentData);
|
|
23
|
+
/**
|
|
24
|
+
* The name of the attachment
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* The content type of the attachment
|
|
29
|
+
*/
|
|
30
|
+
contentType: string;
|
|
31
|
+
/**
|
|
32
|
+
* The content encoded in base64 of the attachment
|
|
33
|
+
*/
|
|
34
|
+
contentInBase64: string;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
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.MailAttachment = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
/**
|
|
15
|
+
* MailAttachment class
|
|
16
|
+
* @class MailAttachment
|
|
17
|
+
* @description Represents an attachment, which can be sent with an email
|
|
18
|
+
*/
|
|
19
|
+
class MailAttachment {
|
|
20
|
+
constructor(data) {
|
|
21
|
+
this.name = data.name;
|
|
22
|
+
this.contentType = data.contentType;
|
|
23
|
+
this.contentInBase64 = Buffer.from(data.content).toString('base64');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.MailAttachment = MailAttachment;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Name des Anhangs' }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], MailAttachment.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, swagger_1.ApiProperty)({ description: 'Content-Type des Anhangs' }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], MailAttachment.prototype, "contentType", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, swagger_1.ApiProperty)({ description: 'Inhalt des Anhangs (in base64 encoded)' }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], MailAttachment.prototype, "contentInBase64", void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { User } from '../../../../../models';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
3
|
+
* MailRecipient class
|
|
4
|
+
* @class MailRecipient
|
|
5
5
|
* @description Represents a recipient, which may be an email address or a username
|
|
6
6
|
*/
|
|
7
7
|
export declare class MailRecipient {
|
|
@@ -14,8 +14,8 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const itlab_functions_1 = require("itlab-functions");
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @class
|
|
17
|
+
* MailRecipient class
|
|
18
|
+
* @class MailRecipient
|
|
19
19
|
* @description Represents a recipient, which may be an email address or a username
|
|
20
20
|
*/
|
|
21
21
|
class MailRecipient {
|
|
@@ -19,12 +19,17 @@ class ParseMongoIdsPipe {
|
|
|
19
19
|
/**
|
|
20
20
|
* Converts the raw input value into an array of valid MongoDB ID strings.
|
|
21
21
|
*
|
|
22
|
-
* @param {unknown}
|
|
22
|
+
* @param {unknown} value - The raw value received from the request query string.
|
|
23
23
|
* @returns {string[]} - Array of valid MongoDB IDs; returns empty array if input is invalid.
|
|
24
24
|
*/
|
|
25
|
-
transform(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
transform(value) {
|
|
26
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
27
|
+
value = Object.values(value);
|
|
28
|
+
}
|
|
29
|
+
if (!Array.isArray(value))
|
|
30
|
+
return undefined;
|
|
31
|
+
const mongoIds = value.filter((v) => (0, class_validator_1.isMongoId)(v)).map((v) => String(v));
|
|
32
|
+
return Array.from(new Set(mongoIds));
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
/**
|
|
@@ -8,9 +8,12 @@ const class_validator_1 = require("class-validator");
|
|
|
8
8
|
*/
|
|
9
9
|
function MongoIdsTransform() {
|
|
10
10
|
return (0, class_transformer_1.Transform)(({ value }) => {
|
|
11
|
-
if (!
|
|
11
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
12
|
+
value = Object.values(value);
|
|
13
|
+
}
|
|
14
|
+
if (!Array.isArray(value))
|
|
12
15
|
return undefined;
|
|
13
|
-
const mongoIds = value.filter((v) => (0, class_validator_1.isMongoId)(v));
|
|
16
|
+
const mongoIds = value.filter((v) => (0, class_validator_1.isMongoId)(v)).map((v) => String(v));
|
|
14
17
|
return Array.from(new Set(mongoIds));
|
|
15
18
|
});
|
|
16
19
|
}
|
|
@@ -11,14 +11,21 @@ const class_transformer_1 = require("class-transformer");
|
|
|
11
11
|
*/
|
|
12
12
|
function StringArrayTransform(opts = {}) {
|
|
13
13
|
return (0, class_transformer_1.Transform)(({ value }) => {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
|
|
15
|
+
value = Object.values(value);
|
|
16
|
+
}
|
|
17
|
+
if (!Array.isArray(value))
|
|
18
|
+
return undefined;
|
|
19
|
+
const transformedValue = value.map((value) => {
|
|
20
|
+
let str = String(value);
|
|
16
21
|
if (opts.trim)
|
|
17
22
|
str = str.trim();
|
|
18
23
|
if (opts.lowercase)
|
|
19
24
|
str = str.toLowerCase();
|
|
20
25
|
return str;
|
|
21
26
|
});
|
|
22
|
-
|
|
27
|
+
if (!opts.unique)
|
|
28
|
+
return transformedValue;
|
|
29
|
+
return Array.from(new Set(transformedValue));
|
|
23
30
|
});
|
|
24
31
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|