From 945859739ee1ab2a8e1c97942aea5daa31408c82 Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Thu, 20 Jun 2024 11:15:29 +0300 Subject: [PATCH 01/13] wip --- lib/src/dto/space.created.event.payload.ts | 6 ++ service/notifications.yml | 6 ++ service/src/common/enums/email.template.ts | 1 + ...n.recipient.template.provider.interface.ts | 1 + .../space.created.notification.builder.ts | 83 +++++++++++++++++++ .../notification/notification.service.ts | 14 +++- .../space.created.license.manager.js | 24 ++++++ 7 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 lib/src/dto/space.created.event.payload.ts create mode 100644 service/src/services/domain/builders/space-created/space.created.notification.builder.ts create mode 100644 service/src/templates/space.created.license.manager.js diff --git a/lib/src/dto/space.created.event.payload.ts b/lib/src/dto/space.created.event.payload.ts new file mode 100644 index 00000000..c5f3eeb5 --- /dev/null +++ b/lib/src/dto/space.created.event.payload.ts @@ -0,0 +1,6 @@ +import { SpaceBaseEventPayload } from "./space.base.event.payload"; + +export interface SpaceCreatedEventPayload extends SpaceBaseEventPayload { + host: string; + plan: string; +} diff --git a/service/notifications.yml b/service/notifications.yml index 3185f65a..b6974fc5 100644 --- a/service/notifications.yml +++ b/service/notifications.yml @@ -276,3 +276,9 @@ recipients: - rule: type: USER_SELF_MANAGEMENT resource_id: + space_created: + - name: admin + rules: + - rule: + type: LICENSE_MANAGER + resource_id: diff --git a/service/src/common/enums/email.template.ts b/service/src/common/enums/email.template.ts index 7977da77..a8f1e904 100644 --- a/service/src/common/enums/email.template.ts +++ b/service/src/common/enums/email.template.ts @@ -36,4 +36,5 @@ export enum EmailTemplate { PLATFORM_FORUM_DISCUSSION_CREATED = 'platform.forum.discussion.created', PLATFORM_FORUM_DISCUSSION_COMMENT = 'platform.forum.discussion.comment', COMMENT_REPLY = 'comment.reply', + SPACE_CREATED_ADMIN = 'space.created.admin', } diff --git a/service/src/core/contracts/notification.recipient.template.provider.interface.ts b/service/src/core/contracts/notification.recipient.template.provider.interface.ts index 2977b99f..1d555b2d 100644 --- a/service/src/core/contracts/notification.recipient.template.provider.interface.ts +++ b/service/src/core/contracts/notification.recipient.template.provider.interface.ts @@ -37,6 +37,7 @@ export type TemplateConfig = { platform_user_removed?: TemplateRuleSet[]; platform_forum_discussion_comment?: TemplateRuleSet[]; comment_reply?: TemplateRuleSet[]; + space_created?: TemplateRuleSet[]; }; export interface INotificationRecipientTemplateProvider { diff --git a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts new file mode 100644 index 00000000..504d3de2 --- /dev/null +++ b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts @@ -0,0 +1,83 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { INotificationBuilder } from '@core/contracts'; +import { NotificationTemplateType } from '@src/types'; +import { + CommentReplyEventPayload, + NotificationEventType, + SpaceCreatedEventPayload, +} from '@alkemio/notifications-lib'; // Import or define the type 'SpaceCreatedEventPayload' +import { User, UserPreferenceType } from '@alkemio/client-lib'; +import { EmailTemplate } from '@src/common/enums/email.template'; +import { + AlkemioUrlGenerator, + NotificationBuilder, + RoleConfig, +} from '../../../application'; +import { ExternalUser } from '@src/core/models'; +import { CommentReplyEmailPayload } from '@src/common/email-template-payload'; + +@Injectable() +export class SpaceCreatedNotificationBuilder implements INotificationBuilder { + constructor( + @Inject(ALKEMIO_URL_GENERATOR) + private readonly alkemioUrlGenerator: AlkemioUrlGenerator, + private readonly notificationBuilder: NotificationBuilder + ) {} + + build( + payload: SpaceCreatedEventPayload + ): Promise { + const roleConfig: RoleConfig[] = [ + { + role: 'license manager', + preferenceType: UserPreferenceType.NotificationPostCreatedAdmin, + emailTemplate: EmailTemplate.SPACE_CREATED_ADMIN, + }, + ]; + + const templateVariables = { + spaceID: payload.space.id, + }; + + return this.notificationBuilder.build({ + payload, + roleConfig, + templateType: 'space_created', + templateVariables, + templatePayloadBuilderFn: this.createTemplatePayload.bind(this), + }); + } + + createTemplatePayload( + eventPayload: CommentReplyEventPayload, + recipient: User | ExternalUser, + sender?: User + ): CommentReplyEmailPayload { + if (!sender) { + throw Error( + `Sender not provided for '${NotificationEventType.SPACE_CREATED}' event` + ); + } + + const notificationPreferenceURL = + this.alkemioUrlGenerator.createUserNotificationPreferencesURL(recipient); + + return { + emailFrom: 'info@alkem.io', + reply: { + message: eventPayload.reply, + createdBy: sender.profile.displayName, + createdByUrl: sender.profile.url, + }, + comment: eventPayload.comment, + recipient: { + firstName: recipient.firstName, + email: recipient.email, + notificationPreferences: notificationPreferenceURL, + }, + platform: { + url: eventPayload.platform.url, + }, + }; + } +} diff --git a/service/src/services/domain/notification/notification.service.ts b/service/src/services/domain/notification/notification.service.ts index 18892ab7..8bc6001b 100644 --- a/service/src/services/domain/notification/notification.service.ts +++ b/service/src/services/domain/notification/notification.service.ts @@ -57,6 +57,8 @@ import { CommentReplyNotificationBuilder } from '../builders/comment-reply/comme import { CommunityExternalInvitationCreatedEventPayload } from '@alkemio/notifications-lib'; import { PlatformGlobalRoleChangeNotificationBuilder } from '../builders/platform-global-role-change/platform.global.role.change.notification.builder'; import { PlatformGlobalRoleChangeEventPayload } from '@alkemio/notifications-lib'; +import { SpaceCreatedNotificationBuilder } from '../builders/space-created/space.created.notification.builder'; +import { SpaceCreatedEventPayload } from '@alkemio/notifications-lib'; @Injectable() export class NotificationService { @@ -87,7 +89,8 @@ export class NotificationService { private collaborationPostCommentNotificationBuilder: CollaborationPostCommentNotificationBuilder, private collaborationCalloutPublishedNotificationBuilder: CollaborationCalloutPublishedNotificationBuilder, private collaborationDiscussionCommentNotificationBuilder: CollaborationDiscussionCommentNotificationBuilder, - private commentReplyNotificationBuilder: CommentReplyNotificationBuilder + private commentReplyNotificationBuilder: CommentReplyNotificationBuilder, + private spaceCreatedNotificationBuilder: SpaceCreatedNotificationBuilder ) {} async sendNotifications( @@ -301,6 +304,15 @@ export class NotificationService { ); } + async sendSpaceCreatedNotification( + payload: SpaceCreatedEventPayload + ): Promise[]> { + return this.sendNotifications( + payload, + this.spaceCreatedNotificationBuilder + ); + } + private async sendNotification( notification: NotificationTemplateType ): Promise { diff --git a/service/src/templates/space.created.license.manager.js b/service/src/templates/space.created.license.manager.js new file mode 100644 index 00000000..e3c5ca20 --- /dev/null +++ b/service/src/templates/space.created.license.manager.js @@ -0,0 +1,24 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +var templates = require('./alkemio.template.blocks'); +/* eslint-disable quotes */ +module.exports = () => ({ + name: 'space-created-license-manager', + title: '', + version: 1, + channels: { + email: { + from: '{{emailFrom}}', + to: '{{recipient.email}}', + subject: '', + html: `{% extends "src/templates/_layouts/email-transactional.html" %} + {% block content %}Hi {{recipient.firstName}},

+ + {{createdBy.firstName}} created a new space: "{{space.profile.displayName}}". +

+ HAVE A LOOK!

+ {% endblock %} + ${templates.footerBlock}`, + }, + }, +}); + From a39d198467661c5885e445e419de446c2395d568 Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Thu, 27 Jun 2024 11:28:27 +0300 Subject: [PATCH 02/13] wip --- lib/package.json | 2 +- lib/src/dto/index.ts | 1 + lib/src/notification.event.type.ts | 1 + service/notifications.yml | 4 +- service/src/app.controller.ts | 27 +++++++- service/src/app.module.ts | 2 + .../common/email-template-payload/index.ts | 1 + .../space.created.email.payload.ts | 14 ++++ .../space.created.notification.builder.ts | 67 ++++++++++++++----- .../notification/notification.service.ts | 17 +++-- .../space.created.license.manager.js | 2 +- 11 files changed, 111 insertions(+), 27 deletions(-) create mode 100644 service/src/common/email-template-payload/space.created.email.payload.ts diff --git a/lib/package.json b/lib/package.json index e5312769..873c2d3b 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/notifications-lib", - "version": "0.8.5", + "version": "0.8.6", "description": "Library for interacting with Alkemio notifications service", "author": "Alkemio Foundation", "private": false, diff --git a/lib/src/dto/index.ts b/lib/src/dto/index.ts index 5b21a680..9660d9f5 100644 --- a/lib/src/dto/index.ts +++ b/lib/src/dto/index.ts @@ -24,3 +24,4 @@ export * from './platform.forum.discussion.comment.event.payload'; export * from './platform.forum.discussion.created.event.payload'; export * from './comment.reply.event.payload'; export * from './virtual.contributor.invitation.created.event.payload'; +export * from './space.created.event.payload'; diff --git a/lib/src/notification.event.type.ts b/lib/src/notification.event.type.ts index 94294c7d..9f147290 100644 --- a/lib/src/notification.event.type.ts +++ b/lib/src/notification.event.type.ts @@ -22,4 +22,5 @@ export enum NotificationEventType { PLATFORM_FORUM_DISCUSSION_CREATED = 'platformForumDiscussionCreated', COMMENT_REPLY = 'commentReply', COMMUNITY_INVITATION_CREATED_VC = 'communityInvitationCreatedVC', + SPACE_CREATED = 'spaceCreated', } diff --git a/service/notifications.yml b/service/notifications.yml index 942bb4c4..108d7e89 100644 --- a/service/notifications.yml +++ b/service/notifications.yml @@ -291,8 +291,8 @@ recipients: type: ORGANIZATION_ADMIN resource_id: space_created: - - name: admin + - name: license manager rules: - rule: - type: LICENSE_MANAGER + type: GLOBAL_LICENSE_MANAGER resource_id: diff --git a/service/src/app.controller.ts b/service/src/app.controller.ts index 621e60c2..334136a0 100644 --- a/service/src/app.controller.ts +++ b/service/src/app.controller.ts @@ -33,11 +33,13 @@ import { PlatformForumDiscussionCommentEventPayload, CommunityInvitationCreatedEventPayload, CommentReplyEventPayload, + VirtualContributorInvitationCreatedEventPayload, + SpacePayload, + // SpaceCreatedEventPayload, } from '@alkemio/notifications-lib'; import { NotificationService } from './services/domain/notification/notification.service'; import { ALKEMIO_CLIENT_ADAPTER, LogContext } from './common/enums'; import { CommunityExternalInvitationCreatedEventPayload } from '@alkemio/notifications-lib'; -import { VirtualContributorInvitationCreatedEventPayload } from '@alkemio/notifications-lib/dist/dto/virtual.contributor.invitation.created.event.payload'; @Controller() export class AppController { @@ -379,6 +381,29 @@ export class AppController { ); } + @EventPattern(NotificationEventType.SPACE_CREATED) + async sendSpaceCreatedNotifications( + // eslint-disable-next-line prettier/prettier + @Payload() + eventPayload: { + host: string; + plan: string; + space: SpacePayload; + triggeredBy: string; + platform: { + url: string; + }; + }, // SpaceCreatedEventPayload, + @Ctx() context: RmqContext + ) { + this.sendNotifications( + eventPayload, + context, + this.notificationService.sendSpaceCreatedNotification(eventPayload), + NotificationEventType.SPACE_CREATED + ); + } + private async sendNotifications( @Payload() eventPayload: BaseEventPayload, @Ctx() context: RmqContext, diff --git a/service/src/app.module.ts b/service/src/app.module.ts index fb7e21f6..ad7fba65 100644 --- a/service/src/app.module.ts +++ b/service/src/app.module.ts @@ -42,6 +42,7 @@ import { AlkemioUrlGeneratorModule } from './services/application/alkemio-url-ge import { PlatformGlobalRoleChangeNotificationBuilder } from './services/domain/builders/platform-global-role-change/platform.global.role.change.notification.builder'; import { VirtualContributorInvitationCreatedNotificationBuilder } from './services/domain/builders/virtual-contributor-invitation-created/virtual.contributor.invitation.created.notification.builder'; import { HealthController } from './health.controller'; +import { SpaceCreatedNotificationBuilder } from './services/domain/builders/space-created/space.created.notification.builder'; @Module({ imports: [ @@ -89,6 +90,7 @@ import { HealthController } from './health.controller'; CommentReplyNotificationBuilder, NotificationService, VirtualContributorInvitationCreatedNotificationBuilder, + SpaceCreatedNotificationBuilder, ], controllers: [AppController, HealthController], }) diff --git a/service/src/common/email-template-payload/index.ts b/service/src/common/email-template-payload/index.ts index 0cd1f6eb..a4cfd54b 100644 --- a/service/src/common/email-template-payload/index.ts +++ b/service/src/common/email-template-payload/index.ts @@ -22,3 +22,4 @@ export * from './platform.forum.discussion.comment.email.payload'; export * from './platform.forum.discussion.created.email.payload'; export * from './comment.reply.email.payload'; export * from './virtual.contributor.invitation.created.email.payload'; +export * from './space.created.email.payload'; diff --git a/service/src/common/email-template-payload/space.created.email.payload.ts b/service/src/common/email-template-payload/space.created.email.payload.ts new file mode 100644 index 00000000..3df5cc18 --- /dev/null +++ b/service/src/common/email-template-payload/space.created.email.payload.ts @@ -0,0 +1,14 @@ +import { SpaceType } from '@alkemio/notifications-lib'; +import { BaseJourneyEmailPayload } from './base.journey.email.payload'; + +export interface SpaceCreatedEmailPayload extends BaseJourneyEmailPayload { + space: { + displayName: string; + url: string; + dateCreated: string; + timeCreated: string; + type: SpaceType; + }; + plan: string; + host: string; +} diff --git a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts index 504d3de2..adb365bb 100644 --- a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts +++ b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts @@ -1,46 +1,66 @@ -import { Inject, Injectable } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { INotificationBuilder } from '@core/contracts'; import { NotificationTemplateType } from '@src/types'; import { - CommentReplyEventPayload, NotificationEventType, - SpaceCreatedEventPayload, + SpacePayload, + // SpaceCreatedEventPayload, } from '@alkemio/notifications-lib'; // Import or define the type 'SpaceCreatedEventPayload' -import { User, UserPreferenceType } from '@alkemio/client-lib'; +// import { User } from '@alkemio/client-lib'; import { EmailTemplate } from '@src/common/enums/email.template'; import { AlkemioUrlGenerator, NotificationBuilder, RoleConfig, } from '../../../application'; -import { ExternalUser } from '@src/core/models'; -import { CommentReplyEmailPayload } from '@src/common/email-template-payload'; +import { ExternalUser, User } from '@src/core/models'; +import { SpaceCreatedEmailPayload } from '@src/common/email-template-payload'; @Injectable() export class SpaceCreatedNotificationBuilder implements INotificationBuilder { constructor( - @Inject(ALKEMIO_URL_GENERATOR) private readonly alkemioUrlGenerator: AlkemioUrlGenerator, - private readonly notificationBuilder: NotificationBuilder + private readonly notificationBuilder: NotificationBuilder< + //SpaceCreatedEventPayload, + { + host: string; + plan: string; + space: SpacePayload; + triggeredBy: string; + platform: { + url: string; + }; + }, + SpaceCreatedEmailPayload + > ) {} build( - payload: SpaceCreatedEventPayload + payload: { + host: string; + plan: string; + space: SpacePayload; + triggeredBy: string; + platform: { + url: string; + }; + } //SpaceCreatedEventPayload ): Promise { const roleConfig: RoleConfig[] = [ { role: 'license manager', - preferenceType: UserPreferenceType.NotificationPostCreatedAdmin, emailTemplate: EmailTemplate.SPACE_CREATED_ADMIN, }, ]; const templateVariables = { spaceID: payload.space.id, + hostID: payload.host, }; return this.notificationBuilder.build({ payload, + // eventUserId: payload.user.id, roleConfig, templateType: 'space_created', templateVariables, @@ -49,10 +69,18 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { } createTemplatePayload( - eventPayload: CommentReplyEventPayload, + eventPayload: { + host: string; + plan: string; + space: SpacePayload; + triggeredBy: string; + platform: { + url: string; + }; + }, //SpaceCreatedEventPayload, recipient: User | ExternalUser, sender?: User - ): CommentReplyEmailPayload { + ): SpaceCreatedEmailPayload { if (!sender) { throw Error( `Sender not provided for '${NotificationEventType.SPACE_CREATED}' event` @@ -64,17 +92,20 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { return { emailFrom: 'info@alkem.io', - reply: { - message: eventPayload.reply, - createdBy: sender.profile.displayName, - createdByUrl: sender.profile.url, - }, - comment: eventPayload.comment, recipient: { firstName: recipient.firstName, email: recipient.email, notificationPreferences: notificationPreferenceURL, }, + host: 'name', + space: { + displayName: eventPayload.space.profile.displayName, + type: eventPayload.space.type, + url: eventPayload.space.profile.url, + dateCreated: 'string', + timeCreated: 'string', + plan: 'string', + }, platform: { url: eventPayload.platform.url, }, diff --git a/service/src/services/domain/notification/notification.service.ts b/service/src/services/domain/notification/notification.service.ts index 05c96f73..6c3e0331 100644 --- a/service/src/services/domain/notification/notification.service.ts +++ b/service/src/services/domain/notification/notification.service.ts @@ -26,9 +26,12 @@ import { CollaborationDiscussionCommentEventPayload, PlatformForumDiscussionCommentEventPayload, CommunityInvitationCreatedEventPayload, + CommunityExternalInvitationCreatedEventPayload, CommentReplyEventPayload, PlatformGlobalRoleChangeEventPayload, VirtualContributorInvitationCreatedEventPayload, + SpacePayload, + // SpaceCreatedEventPayload, } from '@alkemio/notifications-lib'; import { AlkemioClientAdapter } from '@src/services/application/alkemio-client-adapter'; import { NotificationTemplateType } from '@src/types/notification.template.type'; @@ -56,11 +59,8 @@ import { PlatformUserRemovedNotificationBuilder } from '../builders/platform-use import { CollaborationWhiteboardCreatedNotificationBuilder } from '../builders/collaboration-whiteboard-created/collaboration.whiteboard.created.notification.builder'; import { CollaborationDiscussionCommentNotificationBuilder } from '../builders/collaboration-discussion-comment/collaboration.discussion.comment.notification.builder'; import { CommentReplyNotificationBuilder } from '../builders/comment-reply/comment.reply.notification.builder'; -import { CommunityExternalInvitationCreatedEventPayload } from '@alkemio/notifications-lib'; -import { PlatformGlobalRoleChangeEventPayload } from '@alkemio/notifications-lib'; import { PlatformGlobalRoleChangeNotificationBuilder } from '../builders/platform-global-role-change/platform.global.role.change.notification.builder'; import { SpaceCreatedNotificationBuilder } from '../builders/space-created/space.created.notification.builder'; -import { SpaceCreatedEventPayload } from '@alkemio/notifications-lib'; import { VirtualContributorInvitationCreatedNotificationBuilder } from '../builders/virtual-contributor-invitation-created/virtual.contributor.invitation.created.notification.builder'; @Injectable() @@ -318,7 +318,16 @@ export class NotificationService { } async sendSpaceCreatedNotification( - payload: SpaceCreatedEventPayload + payload: { + host: string; + plan: string; + space: SpacePayload; + triggeredBy: string; + platform: { + url: string; + }; + } + // SpaceCreatedEventPayload ): Promise[]> { return this.sendNotifications( payload, diff --git a/service/src/templates/space.created.license.manager.js b/service/src/templates/space.created.license.manager.js index e3c5ca20..9c62f94e 100644 --- a/service/src/templates/space.created.license.manager.js +++ b/service/src/templates/space.created.license.manager.js @@ -13,7 +13,7 @@ module.exports = () => ({ html: `{% extends "src/templates/_layouts/email-transactional.html" %} {% block content %}Hi {{recipient.firstName}},

- {{createdBy.firstName}} created a new space: "{{space.profile.displayName}}". + {{host.name}} created a new space: "{{space.displayName}}" on {{space.dateCreated}} at {{space.timeCreated}} with {{space.plan}} plan.

HAVE A LOOK!

{% endblock %} From 8b1590eac68550fec2bfc8384dccc098302a9a8d Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 09:41:57 +0300 Subject: [PATCH 03/13] Sent notification to license managers when a new space is created --- lib/package-lock.json | 4 +- lib/package.json | 2 +- lib/src/dto/space.created.event.payload.ts | 3 +- service/src/app.controller.ts | 14 +---- .../space.created.email.payload.ts | 12 ++-- service/src/common/enums/email.template.ts | 2 +- .../space.created.notification.builder.ts | 61 ++++--------------- .../notification/notification.service.ts | 14 +---- .../space.created.license.manager.js | 4 +- 9 files changed, 30 insertions(+), 86 deletions(-) diff --git a/lib/package-lock.json b/lib/package-lock.json index bcc9f384..6cb8bd4b 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/notifications-lib", - "version": "0.9.0", + "version": "0.9.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@alkemio/notifications-lib", - "version": "0.9.0", + "version": "0.9.4", "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.32.0" diff --git a/lib/package.json b/lib/package.json index a90a7ab3..b174c1e1 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/notifications-lib", - "version": "0.9.3", + "version": "0.9.4", "description": "Library for interacting with Alkemio notifications service", "author": "Alkemio Foundation", "private": false, diff --git a/lib/src/dto/space.created.event.payload.ts b/lib/src/dto/space.created.event.payload.ts index c5f3eeb5..d0cdce28 100644 --- a/lib/src/dto/space.created.event.payload.ts +++ b/lib/src/dto/space.created.event.payload.ts @@ -1,6 +1,5 @@ import { SpaceBaseEventPayload } from "./space.base.event.payload"; export interface SpaceCreatedEventPayload extends SpaceBaseEventPayload { - host: string; - plan: string; + created: string; } diff --git a/service/src/app.controller.ts b/service/src/app.controller.ts index 3bcf592d..8791595d 100644 --- a/service/src/app.controller.ts +++ b/service/src/app.controller.ts @@ -34,8 +34,8 @@ import { CommunityInvitationCreatedEventPayload, CommentReplyEventPayload, CommunityInvitationVirtualContributorCreatedEventPayload, - SpacePayload, - // SpaceCreatedEventPayload, + CommunityPlatformInvitationCreatedEventPayload, + SpaceCreatedEventPayload, } from '@alkemio/notifications-lib'; import { NotificationService } from './services/domain/notification/notification.service'; import { ALKEMIO_CLIENT_ADAPTER, LogContext } from './common/enums'; @@ -385,15 +385,7 @@ export class AppController { async sendSpaceCreatedNotifications( // eslint-disable-next-line prettier/prettier @Payload() - eventPayload: { - host: string; - plan: string; - space: SpacePayload; - triggeredBy: string; - platform: { - url: string; - }; - }, // SpaceCreatedEventPayload, + eventPayload: SpaceCreatedEventPayload, @Ctx() context: RmqContext ) { this.sendNotifications( diff --git a/service/src/common/email-template-payload/space.created.email.payload.ts b/service/src/common/email-template-payload/space.created.email.payload.ts index 3df5cc18..9bdcc0e5 100644 --- a/service/src/common/email-template-payload/space.created.email.payload.ts +++ b/service/src/common/email-template-payload/space.created.email.payload.ts @@ -1,14 +1,14 @@ -import { SpaceType } from '@alkemio/notifications-lib'; import { BaseJourneyEmailPayload } from './base.journey.email.payload'; export interface SpaceCreatedEmailPayload extends BaseJourneyEmailPayload { space: { displayName: string; url: string; - dateCreated: string; - timeCreated: string; - type: SpaceType; + type: string; + }; + dateCreated: string; + sender: { + name: string; + url: string; }; - plan: string; - host: string; } diff --git a/service/src/common/enums/email.template.ts b/service/src/common/enums/email.template.ts index 9384a813..91a64d4d 100644 --- a/service/src/common/enums/email.template.ts +++ b/service/src/common/enums/email.template.ts @@ -37,5 +37,5 @@ export enum EmailTemplate { PLATFORM_FORUM_DISCUSSION_COMMENT = 'platform.forum.discussion.comment', COMMENT_REPLY = 'comment.reply', COMMUNITY_INVITATION_CREATED_VC_HOST = 'community.invitation.created.vc.host', - SPACE_CREATED_ADMIN = 'space.created.admin', + SPACE_CREATED_ADMIN = 'space.created.license.manager', } diff --git a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts index adb365bb..f3398bd2 100644 --- a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts +++ b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts @@ -1,19 +1,14 @@ import { Injectable } from '@nestjs/common'; import { INotificationBuilder } from '@core/contracts'; import { NotificationTemplateType } from '@src/types'; -import { - NotificationEventType, - SpacePayload, - // SpaceCreatedEventPayload, -} from '@alkemio/notifications-lib'; // Import or define the type 'SpaceCreatedEventPayload' -// import { User } from '@alkemio/client-lib'; +import { SpaceCreatedEventPayload } from '@alkemio/notifications-lib'; import { EmailTemplate } from '@src/common/enums/email.template'; import { AlkemioUrlGenerator, NotificationBuilder, RoleConfig, } from '../../../application'; -import { ExternalUser, User } from '@src/core/models'; +import { PlatformUser, User } from '@src/core/models'; import { SpaceCreatedEmailPayload } from '@src/common/email-template-payload'; @Injectable() @@ -21,30 +16,13 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { constructor( private readonly alkemioUrlGenerator: AlkemioUrlGenerator, private readonly notificationBuilder: NotificationBuilder< - //SpaceCreatedEventPayload, - { - host: string; - plan: string; - space: SpacePayload; - triggeredBy: string; - platform: { - url: string; - }; - }, + SpaceCreatedEventPayload, SpaceCreatedEmailPayload > ) {} build( - payload: { - host: string; - plan: string; - space: SpacePayload; - triggeredBy: string; - platform: { - url: string; - }; - } //SpaceCreatedEventPayload + payload: SpaceCreatedEventPayload ): Promise { const roleConfig: RoleConfig[] = [ { @@ -55,12 +33,12 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { const templateVariables = { spaceID: payload.space.id, - hostID: payload.host, + senderID: payload.triggeredBy, }; return this.notificationBuilder.build({ payload, - // eventUserId: payload.user.id, + eventUserId: undefined, roleConfig, templateType: 'space_created', templateVariables, @@ -69,24 +47,9 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { } createTemplatePayload( - eventPayload: { - host: string; - plan: string; - space: SpacePayload; - triggeredBy: string; - platform: { - url: string; - }; - }, //SpaceCreatedEventPayload, - recipient: User | ExternalUser, - sender?: User + eventPayload: SpaceCreatedEventPayload, + recipient: User | PlatformUser ): SpaceCreatedEmailPayload { - if (!sender) { - throw Error( - `Sender not provided for '${NotificationEventType.SPACE_CREATED}' event` - ); - } - const notificationPreferenceURL = this.alkemioUrlGenerator.createUserNotificationPreferencesURL(recipient); @@ -97,15 +60,15 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { email: recipient.email, notificationPreferences: notificationPreferenceURL, }, - host: 'name', space: { displayName: eventPayload.space.profile.displayName, type: eventPayload.space.type, url: eventPayload.space.profile.url, - dateCreated: 'string', - timeCreated: 'string', - plan: 'string', }, + sender: eventPayload.sender, + dateCreated: new Date(eventPayload.created).toLocaleString('en-GB', { + timeZone: 'UTC', + }), platform: { url: eventPayload.platform.url, }, diff --git a/service/src/services/domain/notification/notification.service.ts b/service/src/services/domain/notification/notification.service.ts index d1a01cb9..c83a67a6 100644 --- a/service/src/services/domain/notification/notification.service.ts +++ b/service/src/services/domain/notification/notification.service.ts @@ -29,8 +29,7 @@ import { CommentReplyEventPayload, PlatformGlobalRoleChangeEventPayload, CommunityInvitationVirtualContributorCreatedEventPayload, - SpacePayload, - // SpaceCreatedEventPayload, + SpaceCreatedEventPayload, } from '@alkemio/notifications-lib'; import { AlkemioClientAdapter } from '@src/services/application/alkemio-client-adapter'; import { NotificationTemplateType } from '@src/types/notification.template.type'; @@ -318,16 +317,7 @@ export class NotificationService { } async sendSpaceCreatedNotification( - payload: { - host: string; - plan: string; - space: SpacePayload; - triggeredBy: string; - platform: { - url: string; - }; - } - // SpaceCreatedEventPayload + payload: SpaceCreatedEventPayload ): Promise[]> { return this.sendNotifications( payload, diff --git a/service/src/templates/space.created.license.manager.js b/service/src/templates/space.created.license.manager.js index 9c62f94e..9c0c12e1 100644 --- a/service/src/templates/space.created.license.manager.js +++ b/service/src/templates/space.created.license.manager.js @@ -9,11 +9,11 @@ module.exports = () => ({ email: { from: '{{emailFrom}}', to: '{{recipient.email}}', - subject: '', + subject: 'New space created - {{space.displayName}}', html: `{% extends "src/templates/_layouts/email-transactional.html" %} {% block content %}Hi {{recipient.firstName}},

- {{host.name}} created a new space: "{{space.displayName}}" on {{space.dateCreated}} at {{space.timeCreated}} with {{space.plan}} plan. + {{sender.name}} created a new space "{{space.displayName}}" on {{dateCreated}} UTC.

HAVE A LOOK!

{% endblock %} From ac86b0d09767cea9ff7284c4ed656cc2fd587c8f Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 10:54:21 +0300 Subject: [PATCH 04/13] Fix date type to be Date --- lib/src/dto/space.created.event.payload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/dto/space.created.event.payload.ts b/lib/src/dto/space.created.event.payload.ts index d0cdce28..f31cd764 100644 --- a/lib/src/dto/space.created.event.payload.ts +++ b/lib/src/dto/space.created.event.payload.ts @@ -1,5 +1,5 @@ import { SpaceBaseEventPayload } from "./space.base.event.payload"; export interface SpaceCreatedEventPayload extends SpaceBaseEventPayload { - created: string; + created: Date; } From 6452aa910935eedba1f25ad31fc7dc784805e23e Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 10:57:36 +0300 Subject: [PATCH 05/13] rename license manager --- service/notifications.yml | 2 +- .../space-created/space.created.notification.builder.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/notifications.yml b/service/notifications.yml index a8446e5b..b4b941f1 100644 --- a/service/notifications.yml +++ b/service/notifications.yml @@ -291,7 +291,7 @@ recipients: type: ORGANIZATION_ADMIN resource_id: space_created: - - name: license manager + - name: licenseManager rules: - rule: type: GLOBAL_LICENSE_MANAGER diff --git a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts index f3398bd2..a675bf0e 100644 --- a/service/src/services/domain/builders/space-created/space.created.notification.builder.ts +++ b/service/src/services/domain/builders/space-created/space.created.notification.builder.ts @@ -26,7 +26,7 @@ export class SpaceCreatedNotificationBuilder implements INotificationBuilder { ): Promise { const roleConfig: RoleConfig[] = [ { - role: 'license manager', + role: 'licenseManager', emailTemplate: EmailTemplate.SPACE_CREATED_ADMIN, }, ]; From 24c6839cab456d8a2e20c06e48ca656454d0fc7a Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Wed, 3 Jul 2024 12:36:45 +0300 Subject: [PATCH 06/13] version package update --- service/package-lock.json | 14 +++++++------- service/package.json | 2 +- service/src/app.controller.ts | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/service/package-lock.json b/service/package-lock.json index efe89510..04cd96f7 100644 --- a/service/package-lock.json +++ b/service/package-lock.json @@ -10,7 +10,7 @@ "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.32.0", - "@alkemio/notifications-lib": "^0.9.3", + "@alkemio/notifications-lib": "^0.9.4", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", "@nestjs/core": "^8.0.5", @@ -186,9 +186,9 @@ } }, "node_modules/@alkemio/notifications-lib": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.3.tgz", - "integrity": "sha512-yqCGNbfT0CYwY0a0H1HZIw6KYiGMfpxch2SMe6BdFUeKaN4AZSiGsG1EuIDCV5/BM4EzYgPMe2O8yUpsAWLz6Q==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.4.tgz", + "integrity": "sha512-KtB1Pm4j8aAJfQm9pfBOzt1NIAbMl4qZa321TY7oqo0HgKbx+Oj+R9Z8ey53AChJdEm5l7003fiEMalaWyz96Q==", "dependencies": { "@alkemio/client-lib": "^0.32.0" }, @@ -14687,9 +14687,9 @@ } }, "@alkemio/notifications-lib": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.3.tgz", - "integrity": "sha512-yqCGNbfT0CYwY0a0H1HZIw6KYiGMfpxch2SMe6BdFUeKaN4AZSiGsG1EuIDCV5/BM4EzYgPMe2O8yUpsAWLz6Q==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.4.tgz", + "integrity": "sha512-KtB1Pm4j8aAJfQm9pfBOzt1NIAbMl4qZa321TY7oqo0HgKbx+Oj+R9Z8ey53AChJdEm5l7003fiEMalaWyz96Q==", "requires": { "@alkemio/client-lib": "^0.32.0" } diff --git a/service/package.json b/service/package.json index 49034dd3..3ee812d4 100644 --- a/service/package.json +++ b/service/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@alkemio/client-lib": "^0.32.0", - "@alkemio/notifications-lib": "^0.9.3", + "@alkemio/notifications-lib": "^0.9.4", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", "@nestjs/core": "^8.0.5", diff --git a/service/src/app.controller.ts b/service/src/app.controller.ts index 8791595d..e56b9ffa 100644 --- a/service/src/app.controller.ts +++ b/service/src/app.controller.ts @@ -383,7 +383,6 @@ export class AppController { @EventPattern(NotificationEventType.SPACE_CREATED) async sendSpaceCreatedNotifications( - // eslint-disable-next-line prettier/prettier @Payload() eventPayload: SpaceCreatedEventPayload, @Ctx() context: RmqContext From 3b88d8741fa71695d7dd1886879ff9cd6aa6d261 Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 12:46:22 +0300 Subject: [PATCH 07/13] Fix date type to be number --- lib/src/dto/space.created.event.payload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/dto/space.created.event.payload.ts b/lib/src/dto/space.created.event.payload.ts index f31cd764..9005de98 100644 --- a/lib/src/dto/space.created.event.payload.ts +++ b/lib/src/dto/space.created.event.payload.ts @@ -1,5 +1,5 @@ import { SpaceBaseEventPayload } from "./space.base.event.payload"; export interface SpaceCreatedEventPayload extends SpaceBaseEventPayload { - created: Date; + created: number; } From c7dcdf6e700ea86315412924101291837d9048d2 Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 12:48:08 +0300 Subject: [PATCH 08/13] update lib version --- lib/package.json | 2 +- service/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/package.json b/lib/package.json index b174c1e1..3a8e4b09 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/notifications-lib", - "version": "0.9.4", + "version": "0.9.5", "description": "Library for interacting with Alkemio notifications service", "author": "Alkemio Foundation", "private": false, diff --git a/service/package.json b/service/package.json index b33c40f4..76adf345 100644 --- a/service/package.json +++ b/service/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@alkemio/client-lib": "^0.32.0", - "@alkemio/notifications-lib": "^0.9.3", + "@alkemio/notifications-lib": "^0.9.5", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", "@nestjs/core": "^8.0.5", From 9ec598d57c688b57342f0a1f820d7d103c3cc879 Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 13:29:02 +0300 Subject: [PATCH 09/13] update type --- lib/src/dto/space.created.event.payload.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/dto/space.created.event.payload.ts b/lib/src/dto/space.created.event.payload.ts index 9005de98..076489fc 100644 --- a/lib/src/dto/space.created.event.payload.ts +++ b/lib/src/dto/space.created.event.payload.ts @@ -2,4 +2,8 @@ import { SpaceBaseEventPayload } from "./space.base.event.payload"; export interface SpaceCreatedEventPayload extends SpaceBaseEventPayload { created: number; + sender: { + name: string; + url: string; + } } From 82919325f5bddd84fa729e6ac5a9564fce6ff0e0 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Wed, 3 Jul 2024 13:56:13 +0300 Subject: [PATCH 10/13] version package update --- lib/package-lock.json | 4 ++-- lib/package.json | 2 +- service/package-lock.json | 14 +++++++------- service/package.json | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/package-lock.json b/lib/package-lock.json index 6cb8bd4b..857a58a9 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alkemio/notifications-lib", - "version": "0.9.3", + "version": "0.9.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@alkemio/notifications-lib", - "version": "0.9.4", + "version": "0.9.6", "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.32.0" diff --git a/lib/package.json b/lib/package.json index 3a8e4b09..e86f6537 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@alkemio/notifications-lib", - "version": "0.9.5", + "version": "0.9.6", "description": "Library for interacting with Alkemio notifications service", "author": "Alkemio Foundation", "private": false, diff --git a/service/package-lock.json b/service/package-lock.json index 04cd96f7..37fa4d52 100644 --- a/service/package-lock.json +++ b/service/package-lock.json @@ -10,7 +10,7 @@ "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.32.0", - "@alkemio/notifications-lib": "^0.9.4", + "@alkemio/notifications-lib": "^0.9.6", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", "@nestjs/core": "^8.0.5", @@ -186,9 +186,9 @@ } }, "node_modules/@alkemio/notifications-lib": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.4.tgz", - "integrity": "sha512-KtB1Pm4j8aAJfQm9pfBOzt1NIAbMl4qZa321TY7oqo0HgKbx+Oj+R9Z8ey53AChJdEm5l7003fiEMalaWyz96Q==", + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.6.tgz", + "integrity": "sha512-xIJ4JOmvo8grfGSeSM7GVfvuXMuIGZoDdcF37hBj/hKguQxzt3fpUMvR7pnWUbC6g5dbXZzoefZblcxreVd3tw==", "dependencies": { "@alkemio/client-lib": "^0.32.0" }, @@ -14687,9 +14687,9 @@ } }, "@alkemio/notifications-lib": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.4.tgz", - "integrity": "sha512-KtB1Pm4j8aAJfQm9pfBOzt1NIAbMl4qZa321TY7oqo0HgKbx+Oj+R9Z8ey53AChJdEm5l7003fiEMalaWyz96Q==", + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/@alkemio/notifications-lib/-/notifications-lib-0.9.6.tgz", + "integrity": "sha512-xIJ4JOmvo8grfGSeSM7GVfvuXMuIGZoDdcF37hBj/hKguQxzt3fpUMvR7pnWUbC6g5dbXZzoefZblcxreVd3tw==", "requires": { "@alkemio/client-lib": "^0.32.0" } diff --git a/service/package.json b/service/package.json index 46a09861..dcb4fdf9 100644 --- a/service/package.json +++ b/service/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@alkemio/client-lib": "^0.32.0", - "@alkemio/notifications-lib": "^0.9.5", + "@alkemio/notifications-lib": "^0.9.6", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", "@nestjs/core": "^8.0.5", From fad187e68b9435e073488a3ec20ce783084becdc Mon Sep 17 00:00:00 2001 From: Emilia Pavlova Date: Wed, 3 Jul 2024 16:33:18 +0300 Subject: [PATCH 11/13] add test dependency --- .../services/domain/notification/notification.service.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/src/services/domain/notification/notification.service.spec.ts b/service/src/services/domain/notification/notification.service.spec.ts index a8588873..9ed0b2db 100644 --- a/service/src/services/domain/notification/notification.service.spec.ts +++ b/service/src/services/domain/notification/notification.service.spec.ts @@ -47,6 +47,7 @@ import { CollaborationWhiteboardCreatedNotificationBuilder } from '../builders/c import { CollaborationDiscussionCommentNotificationBuilder } from '../builders/collaboration-discussion-comment/collaboration.discussion.comment.notification.builder'; import { PlatformGlobalRoleChangeNotificationBuilder } from '../builders/platform-global-role-change/platform.global.role.change.notification.builder'; import { CommunityInvitationVirtualContributorCreatedNotificationBuilder } from '../builders/community-invitation-virtual-contributor-created/community.invitation.virtual.contributor.created.notification.builder'; +import { SpaceCreatedNotificationBuilder } from '../builders/space-created/space.created.notification.builder'; const testData = { ...challengeAdminsData, @@ -97,6 +98,7 @@ describe('NotificationService', () => { MockConfigServiceProvider, MockAlkemioClientAdapterProvider, AlkemioUrlGenerator, + SpaceCreatedNotificationBuilder, ], }).compile(); From 85ccbb93e2f4fcef90b72d6b78e8f829d68b75b7 Mon Sep 17 00:00:00 2001 From: Carlos Cano Date: Thu, 4 Jul 2024 19:43:01 +0200 Subject: [PATCH 12/13] Fix test --- .../notification-builder/notification.builder.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/src/services/application/notification-builder/notification.builder.spec.ts b/service/src/services/application/notification-builder/notification.builder.spec.ts index 99615afe..9b07e22c 100644 --- a/service/src/services/application/notification-builder/notification.builder.spec.ts +++ b/service/src/services/application/notification-builder/notification.builder.spec.ts @@ -62,7 +62,8 @@ describe('NotificationBuilder', () => { await notificationBuilder.build(getBaseOptions()); expect(loggerSpy).toBeCalledWith( - expect.stringContaining('No rule set(s) found for roles') + expect.stringContaining('No rule set(s) found for roles'), + expect.stringMatching('notifications') ); }); }); From 4c5c699f291f0a88effc8a757585f92d13b47397 Mon Sep 17 00:00:00 2001 From: Svetoslav Petkov Date: Fri, 5 Jul 2024 12:27:24 +0300 Subject: [PATCH 13/13] Version bump v2 (#339) * version bump * npm audit fix * reverted audit on service --- lib/package-lock.json | 171 +++++++++++++++----------------------- service/package-lock.json | 4 +- service/package.json | 2 +- 3 files changed, 71 insertions(+), 106 deletions(-) diff --git a/lib/package-lock.json b/lib/package-lock.json index 857a58a9..4a77cd67 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -215,9 +215,9 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -2839,12 +2839,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4258,9 +4258,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -5252,9 +5252,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true, "bin": { @@ -6069,9 +6069,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "bin": { "json5": "lib/cli.js" }, @@ -6325,17 +6325,6 @@ "tslib": "^2.0.3" } }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -6353,9 +6342,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true, "bin": { @@ -7341,12 +7330,9 @@ } }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -7900,9 +7886,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, "peer": true, "dependencies": { @@ -8056,9 +8042,9 @@ } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -8472,9 +8458,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -8516,9 +8502,9 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "peer": true, "engines": { @@ -8561,11 +8547,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -8765,9 +8746,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" } } }, @@ -10792,12 +10773,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-process-hrtime": { @@ -11896,9 +11877,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -12586,9 +12567,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true } @@ -13234,9 +13215,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" }, "kleur": { "version": "3.0.3", @@ -13434,14 +13415,6 @@ "tslib": "^2.0.3" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -13453,9 +13426,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "peer": true } @@ -14176,12 +14149,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==" }, "semver-compare": { "version": "1.0.0", @@ -14626,9 +14596,9 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, "peer": true, "requires": { @@ -14717,9 +14687,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" @@ -15031,9 +15001,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wrap-ansi": { @@ -15066,9 +15036,9 @@ } }, "ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "peer": true, "requires": {} @@ -15094,11 +15064,6 @@ "dev": true, "peer": true }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", diff --git a/service/package-lock.json b/service/package-lock.json index 37fa4d52..9251ac54 100644 --- a/service/package-lock.json +++ b/service/package-lock.json @@ -1,12 +1,12 @@ { "name": "alkemio-notifications", - "version": "0.18.1", + "version": "0.19.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "alkemio-notifications", - "version": "0.18.1", + "version": "0.19.0", "license": "EUPL-1.2", "dependencies": { "@alkemio/client-lib": "^0.32.0", diff --git a/service/package.json b/service/package.json index dcb4fdf9..3f4b63ef 100644 --- a/service/package.json +++ b/service/package.json @@ -1,6 +1,6 @@ { "name": "alkemio-notifications", - "version": "0.18.1", + "version": "0.19.0", "description": "Alkemio notifications service", "author": "Alkemio Foundation", "private": false,