itlab-internal-services 2.16.8 → 2.16.9
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/fetch-options/base-options.class.d.ts +9 -0
- package/dist/classes/fetch-options/comments-options.class.d.ts +3 -0
- package/dist/classes/fetch-options/comments-options.class.js +1 -1
- package/dist/classes/fetch-options/content-options.class.d.ts +3 -0
- package/dist/classes/fetch-options/content-options.class.js +1 -1
- package/dist/classes/fetch-options/drafted-options.class.d.ts +5 -1
- package/dist/classes/fetch-options/drafted-options.class.js +3 -2
- package/dist/classes/fetch-options/liked-by-options.class.d.ts +4 -0
- package/dist/classes/fetch-options/liked-by-options.class.js +1 -1
- package/dist/classes/fetch-options/timestamps-options.class.d.ts +4 -1
- package/dist/classes/fetch-options/timestamps-options.class.js +1 -1
- package/dist/classes/fetch-options/viewed-by-options.class.d.ts +5 -1
- package/dist/classes/fetch-options/viewed-by-options.class.js +1 -1
- package/dist/hub-resource.enum.d.ts +10 -10
- package/dist/hub-resource.enum.js +16 -16
- package/dist/modules/comments/comments.controller.js +1 -1
- package/dist/modules/comments/comments.service.d.ts +5 -5
- package/dist/modules/comments/comments.service.js +21 -13
- package/dist/modules/like/like.service.d.ts +1 -1
- package/dist/modules/like/like.service.js +7 -7
- package/dist/modules/merge/merge-module-options.interface.d.ts +2 -2
- package/dist/modules/merge/merge.controller.d.ts +3 -3
- package/dist/modules/merge/merge.service.interface.d.ts +1 -1
- package/dist/modules/services/base-http.service.d.ts +44 -40
- package/dist/modules/services/base-http.service.js +72 -47
- package/dist/modules/services/base-urls.d.ts +22 -19
- package/dist/modules/services/base-urls.js +38 -19
- package/dist/modules/services/providers/accounts/accounts.service.d.ts +99 -0
- package/dist/modules/services/providers/accounts/accounts.service.js +154 -0
- package/dist/modules/services/providers/accounts/fetch-account-options.dto.v1.type.d.ts +29 -0
- package/dist/modules/services/providers/accounts/index.d.ts +2 -0
- package/dist/modules/services/providers/accounts/index.js +18 -0
- package/dist/modules/services/providers/books/books.service.d.ts +49 -0
- package/dist/modules/services/providers/books/books.service.js +79 -0
- package/dist/modules/services/providers/books/fetch-book-options.dto.v1.type.d.ts +27 -0
- package/dist/modules/services/providers/books/index.d.ts +2 -0
- package/dist/modules/services/providers/{notification → books}/index.js +2 -2
- package/dist/modules/services/providers/changelog/changelog.service.d.ts +62 -0
- package/dist/modules/services/providers/changelog/changelog.service.js +79 -0
- package/dist/modules/services/providers/changelog/fetch-change-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/changelog/index.d.ts +2 -0
- package/dist/modules/services/providers/changelog/index.js +18 -0
- package/dist/modules/services/providers/conflicts/conflicts.service.d.ts +59 -0
- package/dist/modules/services/providers/conflicts/conflicts.service.js +79 -0
- package/dist/modules/services/providers/conflicts/fetch-conflict-options.dto.v1.type.d.ts +18 -0
- package/dist/modules/services/providers/conflicts/index.d.ts +2 -0
- package/dist/modules/services/providers/conflicts/index.js +18 -0
- package/dist/modules/services/providers/content/content-return-types.d.ts +3 -2
- package/dist/modules/services/providers/content/content-return-types.js +8 -2
- package/dist/modules/services/providers/content/content.service.d.ts +49 -7
- package/dist/modules/services/providers/content/content.service.js +61 -19
- package/dist/modules/services/providers/content/fetch-content-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/content/index.d.ts +1 -0
- package/dist/modules/services/providers/content/index.js +1 -0
- package/dist/modules/services/providers/demo-hive/demo-hive.service.d.ts +49 -0
- package/dist/modules/services/providers/demo-hive/demo-hive.service.js +79 -0
- package/dist/modules/services/providers/demo-hive/fetch-demo-options.dto.v1.type.d.ts +16 -0
- package/dist/modules/services/providers/demo-hive/index.d.ts +2 -0
- package/dist/modules/services/providers/demo-hive/index.js +18 -0
- package/dist/modules/services/providers/events/events.service.d.ts +49 -0
- package/dist/modules/services/providers/events/events.service.js +79 -0
- package/dist/modules/services/providers/events/fetch-event-options.dto.v1.type.d.ts +27 -0
- package/dist/modules/services/providers/events/index.d.ts +2 -0
- package/dist/modules/services/providers/events/index.js +18 -0
- package/dist/modules/services/providers/files/crop-image-options.dto.v1.type.d.ts +13 -0
- package/dist/modules/services/providers/files/fetch-file-options.dto.v1.type.d.ts +21 -0
- package/dist/modules/services/providers/files/fetch-folder-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/files/files.service.d.ts +106 -0
- package/dist/modules/services/providers/files/files.service.js +146 -0
- package/dist/modules/services/providers/files/index.d.ts +4 -0
- package/dist/modules/services/providers/files/index.js +20 -0
- package/dist/modules/services/providers/hackschool/fetch-course-options.dto.v1.type.d.ts +15 -0
- package/dist/modules/services/providers/hackschool/fetch-doc-options.dto.v1.type.d.ts +17 -0
- package/dist/modules/services/providers/hackschool/fetch-thread-options.dto.v1.type.d.ts +18 -0
- package/dist/modules/services/providers/hackschool/hackschool.service.d.ts +93 -0
- package/dist/modules/services/providers/hackschool/hackschool.service.js +135 -0
- package/dist/modules/services/providers/hackschool/index.d.ts +2 -0
- package/dist/modules/services/providers/hackschool/index.js +18 -0
- package/dist/modules/services/providers/ideas.service.js +1 -1
- package/dist/modules/services/providers/index.d.ts +15 -12
- package/dist/modules/services/providers/index.js +17 -12
- package/dist/modules/services/providers/lunch-roulette.service.js +1 -1
- package/dist/modules/services/providers/mail/dtos/{auth-login-token-mail.dto.d.ts → auth-login-token-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{auth-password-reset-mail.dto.d.ts → auth-password-reset-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{event-cancel-mail.dto.d.ts → event-cancel-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{event-invite-mail.dto.d.ts → event-invite-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{idea-status-updated-mail.dto.d.ts → idea-status-updated-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/{idea-submitted-mail.dto.d.ts → idea-submitted-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/idea-submitted-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/index.d.ts +14 -14
- package/dist/modules/services/providers/mail/dtos/index.js +14 -14
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-cancel-mail.dto.d.ts → lunch-roulette-cancel-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-matched-mail.dto.d.ts → lunch-roulette-matched-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-matched-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-submitted-mail.dto.d.ts → lunch-roulette-submitted-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{lunch-roulette-unmatched-mail.dto.d.ts → lunch-roulette-unmatched-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-issue-mail.dto.d.ts → newsletter-issue-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-issue-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-subscribed-mail.dto.d.ts → newsletter-subscribed-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-subscribed-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{newsletter-unsubscribed-mail.dto.d.ts → newsletter-unsubscribed-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/dtos/{notification-mail.dto.d.ts → notification-mail.dto.v1.d.ts} +1 -1
- package/dist/modules/services/providers/mail/dtos/notification-mail.dto.v1.js +2 -0
- package/dist/modules/services/providers/mail/mail-types.d.ts +17 -16
- package/dist/modules/services/providers/mail/mail-types.js +31 -14
- package/dist/modules/services/providers/mail/mail.service.d.ts +30 -31
- package/dist/modules/services/providers/mail/mail.service.js +49 -50
- package/dist/modules/services/providers/mail/models/mail-recipient.model.d.ts +2 -0
- package/dist/modules/services/providers/mail/models/mail-recipient.model.js +3 -0
- package/dist/modules/services/providers/newsletter/fetch-issue-options.dto.v1.type.d.ts +16 -0
- package/dist/modules/services/providers/newsletter/fetch-issue-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/newsletter/index.d.ts +2 -0
- package/dist/modules/services/providers/newsletter/index.js +18 -0
- package/dist/modules/services/providers/newsletter/newsletter.service.d.ts +49 -0
- package/dist/modules/services/providers/newsletter/newsletter.service.js +79 -0
- package/dist/modules/services/providers/newsroom/fetch-news-options.dto.v1.type.d.ts +20 -0
- package/dist/modules/services/providers/newsroom/fetch-news-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/newsroom/index.d.ts +2 -0
- package/dist/modules/services/providers/newsroom/index.js +18 -0
- package/dist/modules/services/providers/newsroom/newsroom.service.d.ts +49 -0
- package/dist/modules/services/providers/newsroom/newsroom.service.js +79 -0
- package/dist/modules/services/providers/notifications/dtos/index.d.ts +1 -0
- package/dist/modules/services/providers/{notification → notifications}/dtos/index.js +1 -1
- package/dist/modules/services/providers/{notification/dtos/schedule-notification.dto.d.ts → notifications/dtos/schedule-notification.dto.v1.d.ts} +2 -10
- package/dist/modules/services/providers/notifications/dtos/schedule-notification.dto.v1.js +2 -0
- package/dist/modules/services/providers/notifications/fetch-notification-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/notifications/fetch-notification-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/notifications/index.d.ts +3 -0
- package/dist/modules/services/providers/notifications/index.js +19 -0
- package/dist/modules/services/providers/notifications/notifications.service-definition.d.ts +1 -0
- package/dist/modules/services/providers/notifications/notifications.service-definition.js +4 -0
- package/dist/modules/services/providers/{notification/notification.service.d.ts → notifications/notifications.service.d.ts} +41 -5
- package/dist/modules/services/providers/{notification/notification.service.js → notifications/notifications.service.js} +52 -26
- package/dist/modules/services/providers/pass/dtos/{create-guild-member-pass.dto.d.ts → create-guild-member-pass.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.v1.js +2 -0
- package/dist/modules/services/providers/pass/dtos/{create-team-member-pass.dto.d.ts → create-team-member-pass.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.v1.js +2 -0
- package/dist/modules/services/providers/pass/dtos/index.d.ts +2 -2
- package/dist/modules/services/providers/pass/dtos/index.js +2 -2
- package/dist/modules/services/providers/pass/pass-types.d.ts +3 -3
- package/dist/modules/services/providers/pass/pass.service.d.ts +14 -14
- package/dist/modules/services/providers/pass/pass.service.js +28 -28
- package/dist/modules/services/providers/podcasts/fetch-episode-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/podcasts/fetch-episode-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/podcasts/index.d.ts +2 -0
- package/dist/modules/services/providers/podcasts/index.js +18 -0
- package/dist/modules/services/providers/podcasts/podcasts.service.d.ts +49 -0
- package/dist/modules/services/providers/podcasts/podcasts.service.js +79 -0
- package/dist/modules/services/providers/quick-links/fetch-link-options.dto.v1.type.d.ts +14 -0
- package/dist/modules/services/providers/quick-links/fetch-link-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/quick-links/index.d.ts +2 -0
- package/dist/modules/services/providers/quick-links/index.js +18 -0
- package/dist/modules/services/providers/quick-links/quick-links.service.d.ts +61 -0
- package/dist/modules/services/providers/quick-links/quick-links.service.js +79 -0
- package/dist/modules/services/providers/search/dtos/{index-search-document.dto.d.ts → index-document.dto.v1.d.ts} +2 -2
- package/dist/modules/services/providers/search/dtos/index-document.dto.v1.js +2 -0
- package/dist/modules/services/providers/search/dtos/index.d.ts +1 -1
- package/dist/modules/services/providers/search/dtos/index.js +1 -1
- package/dist/modules/services/providers/search/search.service.d.ts +6 -6
- package/dist/modules/services/providers/search/search.service.js +14 -17
- package/dist/modules/services/providers/team/fetch-member-options.dto.v1.type.d.ts +11 -0
- package/dist/modules/services/providers/team/fetch-member-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/team/index.d.ts +2 -0
- package/dist/modules/services/providers/team/index.js +18 -0
- package/dist/modules/services/providers/team/team.service.d.ts +49 -0
- package/dist/modules/services/providers/team/team.service.js +79 -0
- package/dist/modules/services/providers/tech-radar/fetch-blip-options.dto.v1.type.d.ts +19 -0
- package/dist/modules/services/providers/tech-radar/fetch-blip-options.dto.v1.type.js +2 -0
- package/dist/modules/services/providers/tech-radar/fetch-edition-options.dto.v1.type copy.d.ts +15 -0
- package/dist/modules/services/providers/tech-radar/fetch-edition-options.dto.v1.type copy.js +2 -0
- package/dist/modules/services/providers/tech-radar/index.d.ts +3 -0
- package/dist/modules/services/providers/tech-radar/index.js +19 -0
- package/dist/modules/services/providers/tech-radar/tech-radar.service.d.ts +71 -0
- package/dist/modules/services/providers/tech-radar/tech-radar.service.js +107 -0
- package/dist/modules/services/services.module.js +6 -3
- package/package.json +1 -1
- package/dist/modules/services/providers/accounts.service.d.ts +0 -67
- package/dist/modules/services/providers/accounts.service.js +0 -131
- package/dist/modules/services/providers/books.service.d.ts +0 -29
- package/dist/modules/services/providers/books.service.js +0 -55
- package/dist/modules/services/providers/changelog.service.d.ts +0 -18
- package/dist/modules/services/providers/changelog.service.js +0 -43
- package/dist/modules/services/providers/demo-hive.service.d.ts +0 -29
- package/dist/modules/services/providers/demo-hive.service.js +0 -55
- package/dist/modules/services/providers/events.service.d.ts +0 -29
- package/dist/modules/services/providers/events.service.js +0 -55
- package/dist/modules/services/providers/hackschool.service.d.ts +0 -49
- package/dist/modules/services/providers/hackschool.service.js +0 -79
- package/dist/modules/services/providers/newletter.service.d.ts +0 -29
- package/dist/modules/services/providers/newletter.service.js +0 -55
- package/dist/modules/services/providers/newsroom.service.d.ts +0 -47
- package/dist/modules/services/providers/newsroom.service.js +0 -73
- package/dist/modules/services/providers/notification/dtos/index.d.ts +0 -1
- package/dist/modules/services/providers/notification/index.d.ts +0 -2
- package/dist/modules/services/providers/notification/notification.service-definition.d.ts +0 -1
- package/dist/modules/services/providers/notification/notification.service-definition.js +0 -4
- package/dist/modules/services/providers/podcasts.service.d.ts +0 -29
- package/dist/modules/services/providers/podcasts.service.js +0 -55
- package/dist/modules/services/providers/team.service.d.ts +0 -29
- package/dist/modules/services/providers/team.service.js +0 -55
- package/dist/modules/services/providers/tech-radar.service.d.ts +0 -39
- package/dist/modules/services/providers/tech-radar.service.js +0 -67
- /package/dist/modules/services/providers/{mail/dtos/auth-login-token-mail.dto.js → accounts/fetch-account-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/auth-password-reset-mail.dto.js → books/fetch-book-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/event-cancel-mail.dto.js → changelog/fetch-change-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/event-invite-mail.dto.js → conflicts/fetch-conflict-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/idea-status-updated-mail.dto.js → content/fetch-content-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/idea-submitted-mail.dto.js → demo-hive/fetch-demo-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-cancel-mail.dto.js → events/fetch-event-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-matched-mail.dto.js → files/crop-image-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-submitted-mail.dto.js → files/fetch-file-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → files/fetch-folder-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-issue-mail.dto.js → hackschool/fetch-course-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-subscribed-mail.dto.js → hackschool/fetch-doc-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/{mail/dtos/newsletter-unsubscribed-mail.dto.js → hackschool/fetch-thread-options.dto.v1.type.js} +0 -0
- /package/dist/modules/services/providers/mail/dtos/{notification-mail.dto.js → auth-login-token-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{notification/dtos/schedule-notification.dto.js → mail/dtos/auth-password-reset-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{pass/dtos/create-guild-member-pass.dto.js → mail/dtos/event-cancel-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{pass/dtos/create-team-member-pass.dto.js → mail/dtos/event-invite-mail.dto.v1.js} +0 -0
- /package/dist/modules/services/providers/{search/dtos/index-search-document.dto.js → mail/dtos/idea-status-updated-mail.dto.v1.js} +0 -0
|
@@ -1,8 +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 {
|
|
5
|
-
import { MailType, MailTypeDtoMap } from './mail-types';
|
|
4
|
+
import { AuthLoginTokenMailDtoV1, AuthPasswordResetMailDtoV1, EventCancelMailDtoV1, EventInviteMailDtoV1, IdeaStatusUpdateMailDtoV1, IdeaSubmittedMailDtoV1, LunchRouletteCancelMailDtoV1, LunchRouletteMatchedMailDtoV1, LunchRouletteSubmittedMailDtoV1, LunchRouletteUnmatchedMailDtoV1, NewsletterIssueMailDtoV1, NewsletterSubscribedMailDtoV1, NewsletterUnsubscribedMailDtoV1, NotificationMailDtoV1 } from './dtos';
|
|
6
5
|
/**
|
|
7
6
|
* MailService
|
|
8
7
|
*
|
|
@@ -25,75 +24,75 @@ export declare class MailService extends BaseHttpService {
|
|
|
25
24
|
* @param type - The type of email to send
|
|
26
25
|
* @param payload - The payload DTO corresponding to the type
|
|
27
26
|
*/
|
|
28
|
-
sendMail
|
|
27
|
+
private sendMail;
|
|
29
28
|
/**
|
|
30
29
|
* Sends an email with a one-time login token.
|
|
31
|
-
* @param {
|
|
30
|
+
* @param {AuthLoginTokenMailDtoV1} payload - DTO containing recipient and token.
|
|
32
31
|
*/
|
|
33
|
-
|
|
32
|
+
sendAuthLoginTokenMailV1(payload: AuthLoginTokenMailDtoV1): void;
|
|
34
33
|
/**
|
|
35
34
|
* Sends a password reset email with a secure link.
|
|
36
|
-
* @param {
|
|
35
|
+
* @param {AuthPasswordResetMailDtoV1} payload - DTO containing recipient and reset URL.
|
|
37
36
|
*/
|
|
38
|
-
|
|
37
|
+
sendAuthPasswordResetMailV1(payload: AuthPasswordResetMailDtoV1): void;
|
|
39
38
|
/**
|
|
40
39
|
* Sends an event invitation email.
|
|
41
|
-
* @param {
|
|
40
|
+
* @param {EventInviteMailDtoV1} payload - DTO containing event details and recipient.
|
|
42
41
|
*/
|
|
43
|
-
|
|
42
|
+
sendEventInviteMailV1(payload: EventInviteMailDtoV1): void;
|
|
44
43
|
/**
|
|
45
44
|
* Sends a notification about an event cancellation.
|
|
46
|
-
* @param {
|
|
45
|
+
* @param {EventCancelMailDtoV1} payload - DTO containing event title, time, and links.
|
|
47
46
|
*/
|
|
48
|
-
|
|
47
|
+
sendEventCancelMailV1(payload: EventCancelMailDtoV1): void;
|
|
49
48
|
/**
|
|
50
49
|
* Sends a confirmation that an idea was submitted.
|
|
51
|
-
* @param {
|
|
50
|
+
* @param {IdeaSubmittedMailDtoV1} payload - DTO containing recipient and management URL.
|
|
52
51
|
*/
|
|
53
|
-
|
|
52
|
+
sendIdeaSubmittedMailV1(payload: IdeaSubmittedMailDtoV1): void;
|
|
54
53
|
/**
|
|
55
54
|
* Sends a notification that an idea's status has changed.
|
|
56
|
-
* @param {
|
|
55
|
+
* @param {IdeaStatusUpdateMailDtoV1} payload - DTO containing the old and new status.
|
|
57
56
|
*/
|
|
58
|
-
|
|
57
|
+
sendIdeaStatusUpdateMailV1(payload: IdeaStatusUpdateMailDtoV1): void;
|
|
59
58
|
/**
|
|
60
59
|
* Sends confirmation of lunch roulette participation.
|
|
61
|
-
* @param {
|
|
60
|
+
* @param {LunchRouletteSubmittedMailDtoV1} payload - DTO with recipient, location, and type.
|
|
62
61
|
*/
|
|
63
|
-
|
|
62
|
+
sendLunchRouletteSubmittedMailV1(payload: LunchRouletteSubmittedMailDtoV1): void;
|
|
64
63
|
/**
|
|
65
64
|
* Sends a cancellation email for lunch roulette.
|
|
66
|
-
* @param {
|
|
65
|
+
* @param {LunchRouletteCancelMailDtoV1} payload - DTO containing the recipient.
|
|
67
66
|
*/
|
|
68
|
-
|
|
67
|
+
sendLunchRouletteCancelMailV1(payload: LunchRouletteCancelMailDtoV1): void;
|
|
69
68
|
/**
|
|
70
69
|
* Sends a match notification to lunch roulette participants.
|
|
71
|
-
* @param {
|
|
70
|
+
* @param {LunchRouletteMatchedMailDtoV1} payload - DTO with recipients, message, and details URL.
|
|
72
71
|
*/
|
|
73
|
-
|
|
72
|
+
sendLunchRouletteMatchedMailV1(payload: LunchRouletteMatchedMailDtoV1): void;
|
|
74
73
|
/**
|
|
75
74
|
* Notifies a user that they were unmatched in lunch roulette.
|
|
76
|
-
* @param {
|
|
75
|
+
* @param {LunchRouletteUnmatchedMailDtoV1} payload - DTO with the unmatched recipient.
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
sendLunchRouletteUnmatchedMailV1(payload: LunchRouletteUnmatchedMailDtoV1): void;
|
|
79
78
|
/**
|
|
80
79
|
* Sends confirmation of a newsletter subscription.
|
|
81
|
-
* @param {
|
|
80
|
+
* @param {NewsletterSubscribedMailDtoV1} payload - DTO with recipient information.
|
|
82
81
|
*/
|
|
83
|
-
|
|
82
|
+
sendNewsletterSubscribedMailV1(payload: NewsletterSubscribedMailDtoV1): void;
|
|
84
83
|
/**
|
|
85
84
|
* Sends confirmation of newsletter unsubscription.
|
|
86
|
-
* @param {
|
|
85
|
+
* @param {NewsletterUnsubscribedMailDtoV1} payload - DTO with recipient information.
|
|
87
86
|
*/
|
|
88
|
-
|
|
87
|
+
sendNewsletterUnsubscribedMailV1(payload: NewsletterUnsubscribedMailDtoV1): void;
|
|
89
88
|
/**
|
|
90
89
|
* Sends the latest issue of the newsletter.
|
|
91
|
-
* @param {
|
|
90
|
+
* @param {NewsletterIssueMailDtoV1} payload - DTO containing recipients, content, and metadata.
|
|
92
91
|
*/
|
|
93
|
-
|
|
92
|
+
sendNewsletterIssueMailV1(payload: NewsletterIssueMailDtoV1): void;
|
|
94
93
|
/**
|
|
95
94
|
* Sends a general-purpose email notification.
|
|
96
|
-
* @param {
|
|
95
|
+
* @param {NotificationMailDtoV1} payload - DTO with recipients, title, message, and optional URL.
|
|
97
96
|
*/
|
|
98
|
-
|
|
97
|
+
sendNotificationMailV1(payload: NotificationMailDtoV1): void;
|
|
99
98
|
}
|
|
@@ -18,6 +18,7 @@ const config_1 = require("@nestjs/config");
|
|
|
18
18
|
const authentication_1 = require("../../../authentication");
|
|
19
19
|
const base_http_service_1 = require("../../base-http.service");
|
|
20
20
|
const base_urls_1 = require("../../base-urls");
|
|
21
|
+
const mail_types_1 = require("./mail-types");
|
|
21
22
|
/**
|
|
22
23
|
* MailService
|
|
23
24
|
*
|
|
@@ -33,7 +34,7 @@ let MailService = class MailService extends base_http_service_1.BaseHttpService
|
|
|
33
34
|
* @param configService NestJS configuration service for environment variables and URLs.
|
|
34
35
|
*/
|
|
35
36
|
constructor(authenticationOptions, configService) {
|
|
36
|
-
super('Mail', base_urls_1.BaseUrls.
|
|
37
|
+
super('Mail', base_urls_1.BaseUrls.mailService, authenticationOptions, configService);
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Sends an email of the given type with the provided payload.
|
|
@@ -43,17 +44,15 @@ let MailService = class MailService extends base_http_service_1.BaseHttpService
|
|
|
43
44
|
* @param payload - The payload DTO corresponding to the type
|
|
44
45
|
*/
|
|
45
46
|
sendMail(type, payload) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.client
|
|
50
|
-
.post(`internal/${endpoint}`, payload)
|
|
47
|
+
this.logger.log(`Dispatching email ${type}`);
|
|
48
|
+
this.httpClient
|
|
49
|
+
.post(mail_types_1.MailTypeEndpointMap[type], payload)
|
|
51
50
|
.then(() => {
|
|
52
|
-
this.logger.log(
|
|
51
|
+
this.logger.log(`${type} email sent successfully`);
|
|
53
52
|
})
|
|
54
53
|
.catch((error) => {
|
|
55
54
|
const { message } = this.parseError(error);
|
|
56
|
-
this.logger.error(`Failed to send
|
|
55
|
+
this.logger.error(`Failed to send ${type} email: ${message}`);
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
// ─────────────────────────────────────────────
|
|
@@ -61,116 +60,116 @@ let MailService = class MailService extends base_http_service_1.BaseHttpService
|
|
|
61
60
|
// ─────────────────────────────────────────────
|
|
62
61
|
/**
|
|
63
62
|
* Sends an email with a one-time login token.
|
|
64
|
-
* @param {
|
|
63
|
+
* @param {AuthLoginTokenMailDtoV1} payload - DTO containing recipient and token.
|
|
65
64
|
*/
|
|
66
|
-
|
|
67
|
-
this.sendMail('auth.login-token', payload);
|
|
65
|
+
sendAuthLoginTokenMailV1(payload) {
|
|
66
|
+
this.sendMail('v1.auth.login-token', payload);
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
69
|
* Sends a password reset email with a secure link.
|
|
71
|
-
* @param {
|
|
70
|
+
* @param {AuthPasswordResetMailDtoV1} payload - DTO containing recipient and reset URL.
|
|
72
71
|
*/
|
|
73
|
-
|
|
74
|
-
this.sendMail('auth.password-reset', payload);
|
|
72
|
+
sendAuthPasswordResetMailV1(payload) {
|
|
73
|
+
this.sendMail('v1.auth.password-reset', payload);
|
|
75
74
|
}
|
|
76
75
|
// ─────────────────────────────────────────────
|
|
77
76
|
// Event Emails
|
|
78
77
|
// ─────────────────────────────────────────────
|
|
79
78
|
/**
|
|
80
79
|
* Sends an event invitation email.
|
|
81
|
-
* @param {
|
|
80
|
+
* @param {EventInviteMailDtoV1} payload - DTO containing event details and recipient.
|
|
82
81
|
*/
|
|
83
|
-
|
|
84
|
-
this.sendMail('event.invite', payload);
|
|
82
|
+
sendEventInviteMailV1(payload) {
|
|
83
|
+
this.sendMail('v1.event.invite', payload);
|
|
85
84
|
}
|
|
86
85
|
/**
|
|
87
86
|
* Sends a notification about an event cancellation.
|
|
88
|
-
* @param {
|
|
87
|
+
* @param {EventCancelMailDtoV1} payload - DTO containing event title, time, and links.
|
|
89
88
|
*/
|
|
90
|
-
|
|
91
|
-
this.sendMail('event.cancel', payload);
|
|
89
|
+
sendEventCancelMailV1(payload) {
|
|
90
|
+
this.sendMail('v1.event.cancel', payload);
|
|
92
91
|
}
|
|
93
92
|
// ─────────────────────────────────────────────
|
|
94
93
|
// Idea Submission Emails
|
|
95
94
|
// ─────────────────────────────────────────────
|
|
96
95
|
/**
|
|
97
96
|
* Sends a confirmation that an idea was submitted.
|
|
98
|
-
* @param {
|
|
97
|
+
* @param {IdeaSubmittedMailDtoV1} payload - DTO containing recipient and management URL.
|
|
99
98
|
*/
|
|
100
|
-
|
|
101
|
-
this.sendMail('idea.submitted', payload);
|
|
99
|
+
sendIdeaSubmittedMailV1(payload) {
|
|
100
|
+
this.sendMail('v1.idea.submitted', payload);
|
|
102
101
|
}
|
|
103
102
|
/**
|
|
104
103
|
* Sends a notification that an idea's status has changed.
|
|
105
|
-
* @param {
|
|
104
|
+
* @param {IdeaStatusUpdateMailDtoV1} payload - DTO containing the old and new status.
|
|
106
105
|
*/
|
|
107
|
-
|
|
108
|
-
this.sendMail('idea.status-update', payload);
|
|
106
|
+
sendIdeaStatusUpdateMailV1(payload) {
|
|
107
|
+
this.sendMail('v1.idea.status-update', payload);
|
|
109
108
|
}
|
|
110
109
|
// ─────────────────────────────────────────────
|
|
111
110
|
// Lunch Roulette Emails
|
|
112
111
|
// ─────────────────────────────────────────────
|
|
113
112
|
/**
|
|
114
113
|
* Sends confirmation of lunch roulette participation.
|
|
115
|
-
* @param {
|
|
114
|
+
* @param {LunchRouletteSubmittedMailDtoV1} payload - DTO with recipient, location, and type.
|
|
116
115
|
*/
|
|
117
|
-
|
|
118
|
-
this.sendMail('lunch-roulette.submitted', payload);
|
|
116
|
+
sendLunchRouletteSubmittedMailV1(payload) {
|
|
117
|
+
this.sendMail('v1.lunch-roulette.submitted', payload);
|
|
119
118
|
}
|
|
120
119
|
/**
|
|
121
120
|
* Sends a cancellation email for lunch roulette.
|
|
122
|
-
* @param {
|
|
121
|
+
* @param {LunchRouletteCancelMailDtoV1} payload - DTO containing the recipient.
|
|
123
122
|
*/
|
|
124
|
-
|
|
125
|
-
this.sendMail('lunch-roulette.cancel', payload);
|
|
123
|
+
sendLunchRouletteCancelMailV1(payload) {
|
|
124
|
+
this.sendMail('v1.lunch-roulette.cancel', payload);
|
|
126
125
|
}
|
|
127
126
|
/**
|
|
128
127
|
* Sends a match notification to lunch roulette participants.
|
|
129
|
-
* @param {
|
|
128
|
+
* @param {LunchRouletteMatchedMailDtoV1} payload - DTO with recipients, message, and details URL.
|
|
130
129
|
*/
|
|
131
|
-
|
|
132
|
-
this.sendMail('lunch-roulette.matched', payload);
|
|
130
|
+
sendLunchRouletteMatchedMailV1(payload) {
|
|
131
|
+
this.sendMail('v1.lunch-roulette.matched', payload);
|
|
133
132
|
}
|
|
134
133
|
/**
|
|
135
134
|
* Notifies a user that they were unmatched in lunch roulette.
|
|
136
|
-
* @param {
|
|
135
|
+
* @param {LunchRouletteUnmatchedMailDtoV1} payload - DTO with the unmatched recipient.
|
|
137
136
|
*/
|
|
138
|
-
|
|
139
|
-
this.sendMail('lunch-roulette.unmatched', payload);
|
|
137
|
+
sendLunchRouletteUnmatchedMailV1(payload) {
|
|
138
|
+
this.sendMail('v1.lunch-roulette.unmatched', payload);
|
|
140
139
|
}
|
|
141
140
|
// ─────────────────────────────────────────────
|
|
142
141
|
// Newsletter Emails
|
|
143
142
|
// ─────────────────────────────────────────────
|
|
144
143
|
/**
|
|
145
144
|
* Sends confirmation of a newsletter subscription.
|
|
146
|
-
* @param {
|
|
145
|
+
* @param {NewsletterSubscribedMailDtoV1} payload - DTO with recipient information.
|
|
147
146
|
*/
|
|
148
|
-
|
|
149
|
-
this.sendMail('newsletter.subscribed', payload);
|
|
147
|
+
sendNewsletterSubscribedMailV1(payload) {
|
|
148
|
+
this.sendMail('v1.newsletter.subscribed', payload);
|
|
150
149
|
}
|
|
151
150
|
/**
|
|
152
151
|
* Sends confirmation of newsletter unsubscription.
|
|
153
|
-
* @param {
|
|
152
|
+
* @param {NewsletterUnsubscribedMailDtoV1} payload - DTO with recipient information.
|
|
154
153
|
*/
|
|
155
|
-
|
|
156
|
-
this.sendMail('newsletter.unsubscribed', payload);
|
|
154
|
+
sendNewsletterUnsubscribedMailV1(payload) {
|
|
155
|
+
this.sendMail('v1.newsletter.unsubscribed', payload);
|
|
157
156
|
}
|
|
158
157
|
/**
|
|
159
158
|
* Sends the latest issue of the newsletter.
|
|
160
|
-
* @param {
|
|
159
|
+
* @param {NewsletterIssueMailDtoV1} payload - DTO containing recipients, content, and metadata.
|
|
161
160
|
*/
|
|
162
|
-
|
|
163
|
-
this.sendMail('newsletter.issue', payload);
|
|
161
|
+
sendNewsletterIssueMailV1(payload) {
|
|
162
|
+
this.sendMail('v1.newsletter.issue', payload);
|
|
164
163
|
}
|
|
165
164
|
// ─────────────────────────────────────────────
|
|
166
165
|
// Notification Emails
|
|
167
166
|
// ─────────────────────────────────────────────
|
|
168
167
|
/**
|
|
169
168
|
* Sends a general-purpose email notification.
|
|
170
|
-
* @param {
|
|
169
|
+
* @param {NotificationMailDtoV1} payload - DTO with recipients, title, message, and optional URL.
|
|
171
170
|
*/
|
|
172
|
-
|
|
173
|
-
this.sendMail('notification.notification', payload);
|
|
171
|
+
sendNotificationMailV1(payload) {
|
|
172
|
+
this.sendMail('v1.notification.notification', payload);
|
|
174
173
|
}
|
|
175
174
|
};
|
|
176
175
|
exports.MailService = MailService;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { User } from '../../../../../models';
|
|
1
2
|
/**
|
|
2
3
|
* Recipient class
|
|
3
4
|
* @class Recipient
|
|
@@ -24,4 +25,5 @@ export declare class MailRecipient {
|
|
|
24
25
|
* @returns {string} The string representation of the recipient
|
|
25
26
|
*/
|
|
26
27
|
toString(): string;
|
|
28
|
+
static fromUser(user: User): MailRecipient;
|
|
27
29
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseFetchOptions, CommentsFetchOptions, ContentFetchOptions, DraftedFetchOptions, LikedByFetchOptions, TimestampsFetchOptions, ViewedByFetchOptions } from '../../../../classes';
|
|
2
|
+
/**
|
|
3
|
+
* FetchIssueOptionsDtoV1
|
|
4
|
+
*
|
|
5
|
+
* Data Transfer Object for querying issue collections.
|
|
6
|
+
* Inherits timestamp filtering fields and extends them with
|
|
7
|
+
* issue-specific query parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type FetchIssueOptionsDtoV1 = BaseFetchOptions & TimestampsFetchOptions & DraftedFetchOptions & ContentFetchOptions & ViewedByFetchOptions & LikedByFetchOptions & CommentsFetchOptions & {
|
|
10
|
+
topic?: string;
|
|
11
|
+
topics?: string[];
|
|
12
|
+
year?: number;
|
|
13
|
+
month?: number;
|
|
14
|
+
timestampMin?: number;
|
|
15
|
+
timestampMax?: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fetch-issue-options.dto.v1.type"), exports);
|
|
18
|
+
__exportStar(require("./newsletter.service"), exports);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { LabNewsletter } from 'itlab-functions';
|
|
3
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
4
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
5
|
+
import { FetchIssueOptionsDtoV1 } from './fetch-issue-options.dto.v1.type';
|
|
6
|
+
/**
|
|
7
|
+
* NewsletterService
|
|
8
|
+
*
|
|
9
|
+
* Service client responsible for interacting with the Newsletter microservice.
|
|
10
|
+
* Extends `BaseHttpService` to inherit:
|
|
11
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
12
|
+
* - Secure inter-service authentication.
|
|
13
|
+
* - Structured logging for traceability of outbound requests.
|
|
14
|
+
*
|
|
15
|
+
* Why this pattern?
|
|
16
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
17
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
18
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
19
|
+
*/
|
|
20
|
+
export declare class NewsletterService extends BaseHttpService {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs an Newsletter service client instance.
|
|
23
|
+
*
|
|
24
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
25
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
26
|
+
*/
|
|
27
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a single issue entry by its MongoDB identifier.
|
|
30
|
+
*
|
|
31
|
+
* This method gracefully handles downstream failures by logging
|
|
32
|
+
* and returning `undefined` instead of throwing.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} issueId - Unique MongoDB identifier of the issue.
|
|
35
|
+
* @param {FetchIssueOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
36
|
+
* @returns {Promise<LabNewsletter | undefined>} Resolves to an Issue or `undefined` on failure.
|
|
37
|
+
*/
|
|
38
|
+
fetchIssueV1(issueId: string, options?: FetchIssueOptionsDtoV1): Promise<LabNewsletter | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a collection of issue entries.
|
|
41
|
+
*
|
|
42
|
+
* Useful for batch lookups or paginated listings.
|
|
43
|
+
* Returns an empty array if the downstream service call fails.
|
|
44
|
+
*
|
|
45
|
+
* @param {FetchIssueOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
46
|
+
* @returns {Promise<LabNewsletter[]>} Resolves to a list of issues, or an empty array if none found.
|
|
47
|
+
*/
|
|
48
|
+
fetchIssueCollectionV1(options?: FetchIssueOptionsDtoV1): Promise<LabNewsletter[]>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.NewsletterService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const config_1 = require("@nestjs/config");
|
|
18
|
+
const authentication_1 = require("../../../authentication");
|
|
19
|
+
const base_http_service_1 = require("../../base-http.service");
|
|
20
|
+
const base_urls_1 = require("../../base-urls");
|
|
21
|
+
/**
|
|
22
|
+
* NewsletterService
|
|
23
|
+
*
|
|
24
|
+
* Service client responsible for interacting with the Newsletter microservice.
|
|
25
|
+
* Extends `BaseHttpService` to inherit:
|
|
26
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
27
|
+
* - Secure inter-service authentication.
|
|
28
|
+
* - Structured logging for traceability of outbound requests.
|
|
29
|
+
*
|
|
30
|
+
* Why this pattern?
|
|
31
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
32
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
33
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
34
|
+
*/
|
|
35
|
+
let NewsletterService = class NewsletterService extends base_http_service_1.BaseHttpService {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs an Newsletter service client instance.
|
|
38
|
+
*
|
|
39
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
40
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
41
|
+
*/
|
|
42
|
+
constructor(authenticationOptions, configService) {
|
|
43
|
+
super('Newsletter', base_urls_1.BaseUrls.newsletterService, authenticationOptions, configService);
|
|
44
|
+
}
|
|
45
|
+
// ─────────────────────────────────────────────────────────────
|
|
46
|
+
// Issue Resource Methods
|
|
47
|
+
// ─────────────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves a single issue entry by its MongoDB identifier.
|
|
50
|
+
*
|
|
51
|
+
* This method gracefully handles downstream failures by logging
|
|
52
|
+
* and returning `undefined` instead of throwing.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} issueId - Unique MongoDB identifier of the issue.
|
|
55
|
+
* @param {FetchIssueOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
56
|
+
* @returns {Promise<LabNewsletter | undefined>} Resolves to an Issue or `undefined` on failure.
|
|
57
|
+
*/
|
|
58
|
+
async fetchIssueV1(issueId, options) {
|
|
59
|
+
return this.fetchResource(`v1/internal/issue/${issueId}`, { params: options });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a collection of issue entries.
|
|
63
|
+
*
|
|
64
|
+
* Useful for batch lookups or paginated listings.
|
|
65
|
+
* Returns an empty array if the downstream service call fails.
|
|
66
|
+
*
|
|
67
|
+
* @param {FetchIssueOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
68
|
+
* @returns {Promise<LabNewsletter[]>} Resolves to a list of issues, or an empty array if none found.
|
|
69
|
+
*/
|
|
70
|
+
async fetchIssueCollectionV1(options) {
|
|
71
|
+
return this.fetchResourceCollection(`v1/internal/issues`, { params: options });
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.NewsletterService = NewsletterService;
|
|
75
|
+
exports.NewsletterService = NewsletterService = __decorate([
|
|
76
|
+
(0, common_1.Injectable)(),
|
|
77
|
+
__param(0, (0, authentication_1.InjectAuthenticationOptions)()),
|
|
78
|
+
__metadata("design:paramtypes", [Object, config_1.ConfigService])
|
|
79
|
+
], NewsletterService);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseFetchOptions, CommentsFetchOptions, ContentFetchOptions, DraftedFetchOptions, LikedByFetchOptions, TimestampsFetchOptions, ViewedByFetchOptions } from '../../../../classes';
|
|
2
|
+
/**
|
|
3
|
+
* FetchNewsOptionsDtoV1
|
|
4
|
+
*
|
|
5
|
+
* Data Transfer Object for querying news or user collections.
|
|
6
|
+
* Inherits timestamp filtering fields and extends them with
|
|
7
|
+
* news-specific query parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type FetchNewsOptionsDtoV1 = BaseFetchOptions & TimestampsFetchOptions & DraftedFetchOptions & ContentFetchOptions & ViewedByFetchOptions & LikedByFetchOptions & CommentsFetchOptions & {
|
|
10
|
+
includeAuthors?: boolean;
|
|
11
|
+
isFeatured?: boolean;
|
|
12
|
+
topic?: string;
|
|
13
|
+
topics?: string[];
|
|
14
|
+
authorId?: string;
|
|
15
|
+
authorIds?: string[];
|
|
16
|
+
year?: number;
|
|
17
|
+
month?: number;
|
|
18
|
+
timestampMin?: number;
|
|
19
|
+
timestampMax?: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fetch-news-options.dto.v1.type"), exports);
|
|
18
|
+
__exportStar(require("./newsroom.service"), exports);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { LabNews } from 'itlab-functions';
|
|
3
|
+
import { AuthenticationModuleOptions } from '../../../authentication';
|
|
4
|
+
import { BaseHttpService } from '../../base-http.service';
|
|
5
|
+
import { FetchNewsOptionsDtoV1 } from './fetch-news-options.dto.v1.type';
|
|
6
|
+
/**
|
|
7
|
+
* NewsroomService
|
|
8
|
+
*
|
|
9
|
+
* Service client responsible for interacting with the Newsroom microservice.
|
|
10
|
+
* Extends `BaseHttpService` to inherit:
|
|
11
|
+
* - Environment-sensitive URL resolution (internal vs. external).
|
|
12
|
+
* - Secure inter-service authentication.
|
|
13
|
+
* - Structured logging for traceability of outbound requests.
|
|
14
|
+
*
|
|
15
|
+
* Why this pattern?
|
|
16
|
+
* - Ensures all outbound calls follow a unified configuration and logging structure.
|
|
17
|
+
* - Promotes strong typing and maintainable HTTP logic.
|
|
18
|
+
* - Makes service interactions predictable and debuggable across environments.
|
|
19
|
+
*/
|
|
20
|
+
export declare class NewsroomService extends BaseHttpService {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs an Newsroom service client instance.
|
|
23
|
+
*
|
|
24
|
+
* @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration.
|
|
25
|
+
* @param {ConfigService} configService - NestJS ConfigService for environment detection.
|
|
26
|
+
*/
|
|
27
|
+
constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a single news entry by its MongoDB identifier.
|
|
30
|
+
*
|
|
31
|
+
* This method gracefully handles downstream failures by logging
|
|
32
|
+
* and returning `undefined` instead of throwing.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} newsId - Unique MongoDB identifier of the news.
|
|
35
|
+
* @param {FetchNewsOptionsDtoV1} [options] - Optional query parameters for filtering or projection.
|
|
36
|
+
* @returns {Promise<LabNews | undefined>} Resolves to an News or `undefined` on failure.
|
|
37
|
+
*/
|
|
38
|
+
fetchNewsV1(newsId: string, options?: FetchNewsOptionsDtoV1): Promise<LabNews | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a collection of news entries.
|
|
41
|
+
*
|
|
42
|
+
* Useful for batch lookups or paginated listings.
|
|
43
|
+
* Returns an empty array if the downstream service call fails.
|
|
44
|
+
*
|
|
45
|
+
* @param {FetchNewsOptionsDtoV1} [options] - Optional filter options for narrowing results.
|
|
46
|
+
* @returns {Promise<LabNews[]>} Resolves to a list of news, or an empty array if none found.
|
|
47
|
+
*/
|
|
48
|
+
fetchNewsCollectionV1(options?: FetchNewsOptionsDtoV1): Promise<LabNews[]>;
|
|
49
|
+
}
|