@backstage/plugin-notifications-backend-module-email 0.3.10-next.1 → 0.3.10-next.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @backstage/plugin-notifications-backend-module-email
2
2
 
3
+ ## 0.3.10-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a150bf: Internal changes to switch to the non-alpha `catalogServiceRef`
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@1.4.0-next.1
10
+ - @backstage/catalog-client@1.10.1-next.0
11
+ - @backstage/catalog-model@1.7.4
12
+ - @backstage/config@1.3.2
13
+ - @backstage/integration-aws-node@0.1.16
14
+ - @backstage/types@1.2.1
15
+ - @backstage/plugin-catalog-node@1.17.1-next.1
16
+ - @backstage/plugin-notifications-common@0.0.9-next.0
17
+ - @backstage/plugin-notifications-node@0.2.16-next.1
18
+
3
19
  ## 0.3.10-next.1
4
20
 
5
21
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var backendPluginApi = require('@backstage/backend-plugin-api');
4
- var alpha = require('@backstage/plugin-catalog-node/alpha');
4
+ var pluginCatalogNode = require('@backstage/plugin-catalog-node');
5
5
  var pluginNotificationsNode = require('@backstage/plugin-notifications-node');
6
6
  var NotificationsEmailProcessor = require('./processor/NotificationsEmailProcessor.cjs.js');
7
7
  var extensions = require('./extensions.cjs.js');
@@ -26,7 +26,7 @@ const notificationsModuleEmail = backendPluginApi.createBackendModule({
26
26
  logger: backendPluginApi.coreServices.logger,
27
27
  auth: backendPluginApi.coreServices.auth,
28
28
  cache: backendPluginApi.coreServices.cache,
29
- catalog: alpha.catalogServiceRef
29
+ catalog: pluginCatalogNode.catalogServiceRef
30
30
  },
31
31
  async init({ config, notifications, logger, auth, cache, catalog }) {
32
32
  notifications.addProcessor(
@@ -1 +1 @@
1
- {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';\nimport { notificationsProcessingExtensionPoint } from '@backstage/plugin-notifications-node';\nimport { NotificationsEmailProcessor } from './processor';\nimport {\n notificationsEmailTemplateExtensionPoint,\n NotificationTemplateRenderer,\n} from './extensions';\n\n/**\n * @public\n */\nexport const notificationsModuleEmail = createBackendModule({\n pluginId: 'notifications',\n moduleId: 'email',\n register(reg) {\n let templateRenderer: NotificationTemplateRenderer | undefined;\n reg.registerExtensionPoint(notificationsEmailTemplateExtensionPoint, {\n setTemplateRenderer(renderer) {\n if (templateRenderer) {\n throw new Error(`Email template renderer was already registered`);\n }\n templateRenderer = renderer;\n },\n });\n\n reg.registerInit({\n deps: {\n config: coreServices.rootConfig,\n notifications: notificationsProcessingExtensionPoint,\n logger: coreServices.logger,\n auth: coreServices.auth,\n cache: coreServices.cache,\n catalog: catalogServiceRef,\n },\n async init({ config, notifications, logger, auth, cache, catalog }) {\n notifications.addProcessor(\n new NotificationsEmailProcessor(\n logger,\n config,\n catalog,\n auth,\n cache,\n templateRenderer,\n ),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","notificationsEmailTemplateExtensionPoint","coreServices","notificationsProcessingExtensionPoint","catalogServiceRef","NotificationsEmailProcessor"],"mappings":";;;;;;;;AA8BO,MAAM,2BAA2BA,oCAAoB,CAAA;AAAA,EAC1D,QAAU,EAAA,eAAA;AAAA,EACV,QAAU,EAAA,OAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAI,IAAA,gBAAA;AACJ,IAAA,GAAA,CAAI,uBAAuBC,mDAA0C,EAAA;AAAA,MACnE,oBAAoB,QAAU,EAAA;AAC5B,QAAA,IAAI,gBAAkB,EAAA;AACpB,UAAM,MAAA,IAAI,MAAM,CAAgD,8CAAA,CAAA,CAAA;AAAA;AAElE,QAAmB,gBAAA,GAAA,QAAA;AAAA;AACrB,KACD,CAAA;AAED,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,aAAe,EAAAC,6DAAA;AAAA,QACf,QAAQD,6BAAa,CAAA,MAAA;AAAA,QACrB,MAAMA,6BAAa,CAAA,IAAA;AAAA,QACnB,OAAOA,6BAAa,CAAA,KAAA;AAAA,QACpB,OAAS,EAAAE;AAAA,OACX;AAAA,MACA,MAAM,KAAK,EAAE,MAAA,EAAQ,eAAe,MAAQ,EAAA,IAAA,EAAM,KAAO,EAAA,OAAA,EAAW,EAAA;AAClE,QAAc,aAAA,CAAA,YAAA;AAAA,UACZ,IAAIC,uDAAA;AAAA,YACF,MAAA;AAAA,YACA,MAAA;AAAA,YACA,OAAA;AAAA,YACA,IAAA;AAAA,YACA,KAAA;AAAA,YACA;AAAA;AACF,SACF;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node';\nimport { notificationsProcessingExtensionPoint } from '@backstage/plugin-notifications-node';\nimport { NotificationsEmailProcessor } from './processor';\nimport {\n notificationsEmailTemplateExtensionPoint,\n NotificationTemplateRenderer,\n} from './extensions';\n\n/**\n * @public\n */\nexport const notificationsModuleEmail = createBackendModule({\n pluginId: 'notifications',\n moduleId: 'email',\n register(reg) {\n let templateRenderer: NotificationTemplateRenderer | undefined;\n reg.registerExtensionPoint(notificationsEmailTemplateExtensionPoint, {\n setTemplateRenderer(renderer) {\n if (templateRenderer) {\n throw new Error(`Email template renderer was already registered`);\n }\n templateRenderer = renderer;\n },\n });\n\n reg.registerInit({\n deps: {\n config: coreServices.rootConfig,\n notifications: notificationsProcessingExtensionPoint,\n logger: coreServices.logger,\n auth: coreServices.auth,\n cache: coreServices.cache,\n catalog: catalogServiceRef,\n },\n async init({ config, notifications, logger, auth, cache, catalog }) {\n notifications.addProcessor(\n new NotificationsEmailProcessor(\n logger,\n config,\n catalog,\n auth,\n cache,\n templateRenderer,\n ),\n );\n },\n });\n },\n});\n"],"names":["createBackendModule","notificationsEmailTemplateExtensionPoint","coreServices","notificationsProcessingExtensionPoint","catalogServiceRef","NotificationsEmailProcessor"],"mappings":";;;;;;;;AA+BO,MAAM,2BAA2BA,oCAAoB,CAAA;AAAA,EAC1D,QAAU,EAAA,eAAA;AAAA,EACV,QAAU,EAAA,OAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAI,IAAA,gBAAA;AACJ,IAAA,GAAA,CAAI,uBAAuBC,mDAA0C,EAAA;AAAA,MACnE,oBAAoB,QAAU,EAAA;AAC5B,QAAA,IAAI,gBAAkB,EAAA;AACpB,UAAM,MAAA,IAAI,MAAM,CAAgD,8CAAA,CAAA,CAAA;AAAA;AAElE,QAAmB,gBAAA,GAAA,QAAA;AAAA;AACrB,KACD,CAAA;AAED,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,aAAe,EAAAC,6DAAA;AAAA,QACf,QAAQD,6BAAa,CAAA,MAAA;AAAA,QACrB,MAAMA,6BAAa,CAAA,IAAA;AAAA,QACnB,OAAOA,6BAAa,CAAA,KAAA;AAAA,QACpB,OAAS,EAAAE;AAAA,OACX;AAAA,MACA,MAAM,KAAK,EAAE,MAAA,EAAQ,eAAe,MAAQ,EAAA,IAAA,EAAM,KAAO,EAAA,OAAA,EAAW,EAAA;AAClE,QAAc,aAAA,CAAA,YAAA;AAAA,UACZ,IAAIC,uDAAA;AAAA,YACF,MAAA;AAAA,YACA,MAAA;AAAA,YACA,OAAA;AAAA,YACA,IAAA;AAAA,YACA,KAAA;AAAA,YACA;AAAA;AACF,SACF;AAAA;AACF,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
@@ -107,10 +107,6 @@ class NotificationsEmailProcessor {
107
107
  if (cached) {
108
108
  return cached;
109
109
  }
110
- const { token } = await this.auth.getPluginRequestToken({
111
- onBehalfOf: await this.auth.getOwnServiceCredentials(),
112
- targetPluginId: "catalog"
113
- });
114
110
  const entities = await this.catalog.getEntities(
115
111
  {
116
112
  filter: [
@@ -118,7 +114,7 @@ class NotificationsEmailProcessor {
118
114
  ],
119
115
  fields: ["spec.profile.email"]
120
116
  },
121
- { token }
117
+ { credentials: await this.auth.getOwnServiceCredentials() }
122
118
  );
123
119
  const ret = lodash.compact([
124
120
  ...new Set(
@@ -139,11 +135,9 @@ class NotificationsEmailProcessor {
139
135
  if (cached) {
140
136
  return cached;
141
137
  }
142
- const { token } = await this.auth.getPluginRequestToken({
143
- onBehalfOf: await this.auth.getOwnServiceCredentials(),
144
- targetPluginId: "catalog"
138
+ const entity = await this.catalog.getEntityByRef(entityRef, {
139
+ credentials: await this.auth.getOwnServiceCredentials()
145
140
  });
146
- const entity = await this.catalog.getEntityByRef(entityRef, { token });
147
141
  const ret = [];
148
142
  if (entity) {
149
143
  const userEntity = entity;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsEmailProcessor.cjs.js","sources":["../../src/processor/NotificationsEmailProcessor.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n NotificationProcessor,\n NotificationSendOptions,\n} from '@backstage/plugin-notifications-node';\nimport {\n AuthService,\n CacheService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { CATALOG_FILTER_EXISTS, CatalogApi } from '@backstage/catalog-client';\nimport {\n getProcessorFiltersFromConfig,\n Notification,\n NotificationProcessorFilters,\n} from '@backstage/plugin-notifications-common';\nimport {\n createAzureTransport,\n createSendmailTransport,\n createSesTransport,\n createSmtpTransport,\n createStreamTransport,\n} from './transports';\nimport { UserEntity } from '@backstage/catalog-model';\nimport { compact } from 'lodash';\nimport { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node';\nimport { NotificationTemplateRenderer } from '../extensions';\nimport Mail from 'nodemailer/lib/mailer';\nimport pThrottle from 'p-throttle';\n\nexport class NotificationsEmailProcessor implements NotificationProcessor {\n private transporter: any;\n private readonly broadcastConfig?: Config;\n private readonly transportConfig: Config;\n private readonly sender: string;\n private readonly replyTo?: string;\n private readonly cacheTtl: number;\n private readonly concurrencyLimit: number;\n private readonly throttleInterval: number;\n private readonly frontendBaseUrl: string;\n private readonly filter: NotificationProcessorFilters;\n private readonly allowlistEmailAddresses?: string[];\n private readonly denylistEmailAddresses?: string[];\n\n constructor(\n private readonly logger: LoggerService,\n private readonly config: Config,\n private readonly catalog: CatalogApi,\n private readonly auth: AuthService,\n private readonly cache?: CacheService,\n private readonly templateRenderer?: NotificationTemplateRenderer,\n ) {\n const emailProcessorConfig = config.getConfig(\n 'notifications.processors.email',\n );\n this.transportConfig = emailProcessorConfig.getConfig('transportConfig');\n this.broadcastConfig =\n emailProcessorConfig.getOptionalConfig('broadcastConfig');\n this.sender = emailProcessorConfig.getString('sender');\n this.replyTo = emailProcessorConfig.getOptionalString('replyTo');\n this.concurrencyLimit =\n emailProcessorConfig.getOptionalNumber('concurrencyLimit') ?? 2;\n this.throttleInterval = emailProcessorConfig.has('throttleInterval')\n ? durationToMilliseconds(\n readDurationFromConfig(emailProcessorConfig, {\n key: 'throttleInterval',\n }),\n )\n : 100;\n this.cacheTtl = emailProcessorConfig.has('cache.ttl')\n ? durationToMilliseconds(\n readDurationFromConfig(emailProcessorConfig, { key: 'cache.ttl' }),\n )\n : 3_600_000;\n this.frontendBaseUrl = config.getString('app.baseUrl');\n this.allowlistEmailAddresses = emailProcessorConfig.getOptionalStringArray(\n 'allowlistEmailAddresses',\n );\n this.denylistEmailAddresses = emailProcessorConfig.getOptionalStringArray(\n 'denylistEmailAddresses',\n );\n this.filter = getProcessorFiltersFromConfig(emailProcessorConfig);\n }\n\n private async getTransporter() {\n if (this.transporter) {\n return this.transporter;\n }\n const transport = this.transportConfig.getString('transport');\n if (transport === 'smtp') {\n this.transporter = createSmtpTransport(this.transportConfig);\n } else if (transport === 'ses') {\n const awsCredentialsManager = DefaultAwsCredentialsManager.fromConfig(\n this.config,\n );\n this.transporter = await createSesTransport(\n this.transportConfig,\n awsCredentialsManager,\n );\n } else if (transport === 'sendmail') {\n this.transporter = createSendmailTransport(this.transportConfig);\n } else if (transport === 'stream') {\n this.transporter = createStreamTransport();\n } else if (transport === 'azure') {\n this.transporter = createAzureTransport(this.transportConfig);\n } else {\n throw new Error(`Unsupported transport: ${transport}`);\n }\n return this.transporter;\n }\n\n getName(): string {\n return 'Email';\n }\n\n private async getBroadcastEmails(): Promise<string[]> {\n if (!this.broadcastConfig) {\n return [];\n }\n\n const receiver = this.broadcastConfig.getString('receiver');\n if (receiver === 'none') {\n return [];\n }\n\n if (receiver === 'config') {\n return (\n this.broadcastConfig.getOptionalStringArray('receiverEmails') ?? []\n );\n }\n\n if (receiver === 'users') {\n const cached = await this.cache?.get<string[]>('user-emails:all');\n if (cached) {\n return cached;\n }\n\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n const entities = await this.catalog.getEntities(\n {\n filter: [\n { kind: 'user', 'spec.profile.email': CATALOG_FILTER_EXISTS },\n ],\n fields: ['spec.profile.email'],\n },\n { token },\n );\n const ret = compact([\n ...new Set(\n entities.items.map(entity => {\n return (entity as UserEntity)?.spec.profile?.email;\n }),\n ),\n ]);\n\n await this.cache?.set('user-emails:all', ret, {\n ttl: this.cacheTtl,\n });\n return ret;\n }\n\n throw new Error(`Unsupported broadcast receiver: ${receiver}`);\n }\n\n private async getUserEmail(entityRef: string): Promise<string[]> {\n const cached = await this.cache?.get<string[]>(`user-emails:${entityRef}`);\n if (cached) {\n return cached;\n }\n\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'catalog',\n });\n const entity = await this.catalog.getEntityByRef(entityRef, { token });\n const ret: string[] = [];\n if (entity) {\n const userEntity = entity as UserEntity;\n if (userEntity.spec.profile?.email) {\n ret.push(userEntity.spec.profile.email);\n }\n }\n\n await this.cache?.set(`user-emails:${entityRef}`, ret, {\n ttl: this.cacheTtl,\n });\n\n return ret;\n }\n\n private async getRecipientEmails(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<string[]> {\n let emails: string[];\n if (options.recipients.type === 'broadcast') {\n emails = await this.getBroadcastEmails();\n } else if (options.recipients.type === 'entity' && !!notification.user) {\n emails = await this.getUserEmail(notification.user);\n } else {\n this.logger.info(\n `Unknown notification type ${options.recipients.type} or missing user.`,\n );\n return [];\n }\n\n if (this.allowlistEmailAddresses) {\n emails = emails.filter(email =>\n this.allowlistEmailAddresses?.includes(email),\n );\n }\n\n if (this.denylistEmailAddresses) {\n emails = emails.filter(\n email => !this.denylistEmailAddresses?.includes(email),\n );\n }\n return emails;\n }\n\n private async sendMail(options: Mail.Options) {\n try {\n this.logger.debug(`Sending notification email to ${options.to}`);\n await this.transporter.sendMail(options);\n } catch (e) {\n this.logger.error(`Failed to send email to ${options.to}: ${e}`);\n }\n }\n\n private async sendMails(options: Mail.Options, emails: string[]) {\n const throttle = pThrottle({\n limit: this.concurrencyLimit,\n interval: this.throttleInterval,\n });\n\n const throttled = throttle((opts: Mail.Options) => this.sendMail(opts));\n await Promise.all(\n emails.map(email => throttled({ ...options, to: email })),\n );\n }\n\n private getNotificationLink(notification: Notification) {\n if (notification.payload.link) {\n const stripLeadingSlash = (s: string) => s.replace(/^\\//, '');\n const ensureTrailingSlash = (s: string) => s.replace(/\\/?$/, '/');\n\n try {\n const url = new URL(\n stripLeadingSlash(notification.payload.link),\n ensureTrailingSlash(this.frontendBaseUrl),\n );\n return url.toString();\n } catch (_e) {\n // noop: fallback to relative URL\n }\n return notification.payload.link;\n }\n return `${this.frontendBaseUrl}/notifications`;\n }\n\n private getHtmlContent(notification: Notification) {\n const contentParts: string[] = [];\n if (notification.payload.description) {\n contentParts.push(`${notification.payload.description}`);\n }\n const link = this.getNotificationLink(notification);\n contentParts.push(`<a href=\"${link}\">${link}</a>`);\n return `<p>${contentParts.join('<br/>')}</p>`;\n }\n\n private getTextContent(notification: Notification) {\n const contentParts: string[] = [];\n if (notification.payload.description) {\n contentParts.push(notification.payload.description);\n }\n contentParts.push(this.getNotificationLink(notification));\n return contentParts.join('\\n\\n');\n }\n\n private async sendPlainEmail(notification: Notification, emails: string[]) {\n const mailOptions = {\n from: this.sender,\n subject: notification.payload.title,\n html: this.getHtmlContent(notification),\n text: this.getTextContent(notification),\n replyTo: this.replyTo,\n };\n\n await this.sendMails(mailOptions, emails);\n }\n\n private async sendTemplateEmail(\n notification: Notification,\n emails: string[],\n ) {\n const mailOptions = {\n from: this.sender,\n subject:\n (await this.templateRenderer?.getSubject?.(notification)) ??\n notification.payload.title,\n html: await this.templateRenderer?.getHtml?.(notification),\n text: await this.templateRenderer?.getText?.(notification),\n replyTo: this.replyTo,\n };\n\n await this.sendMails(mailOptions, emails);\n }\n\n async postProcess(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<void> {\n this.transporter = await this.getTransporter();\n\n let emails: string[] = [];\n try {\n emails = await this.getRecipientEmails(notification, options);\n } catch (e) {\n this.logger.error(`Failed to resolve recipient emails: ${e}`);\n return;\n }\n\n if (emails.length === 0) {\n this.logger.info(\n `No email recipients found for notification: ${notification.id}, skipping`,\n );\n return;\n }\n\n this.logger.debug(`Sending notification emails to: ${emails.join(',')}`);\n\n if (!this.templateRenderer) {\n await this.sendPlainEmail(notification, emails);\n return;\n }\n\n await this.sendTemplateEmail(notification, emails);\n }\n\n getNotificationFilters(): NotificationProcessorFilters {\n return this.filter;\n }\n}\n"],"names":["config","durationToMilliseconds","readDurationFromConfig","getProcessorFiltersFromConfig","createSmtpTransport","DefaultAwsCredentialsManager","createSesTransport","createSendmailTransport","createStreamTransport","createAzureTransport","CATALOG_FILTER_EXISTS","compact","pThrottle"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CO,MAAM,2BAA6D,CAAA;AAAA,EAcxE,YACmB,MACA,EAAAA,QAAA,EACA,OACA,EAAA,IAAA,EACA,OACA,gBACjB,EAAA;AANiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAAA,QAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAA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EhB;;;;"}
1
+ {"version":3,"file":"NotificationsEmailProcessor.cjs.js","sources":["../../src/processor/NotificationsEmailProcessor.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n NotificationProcessor,\n NotificationSendOptions,\n} from '@backstage/plugin-notifications-node';\nimport {\n AuthService,\n CacheService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';\nimport {\n getProcessorFiltersFromConfig,\n Notification,\n NotificationProcessorFilters,\n} from '@backstage/plugin-notifications-common';\nimport {\n createAzureTransport,\n createSendmailTransport,\n createSesTransport,\n createSmtpTransport,\n createStreamTransport,\n} from './transports';\nimport { UserEntity } from '@backstage/catalog-model';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\nimport { compact } from 'lodash';\nimport { DefaultAwsCredentialsManager } from '@backstage/integration-aws-node';\nimport { NotificationTemplateRenderer } from '../extensions';\nimport Mail from 'nodemailer/lib/mailer';\nimport pThrottle from 'p-throttle';\n\nexport class NotificationsEmailProcessor implements NotificationProcessor {\n private transporter: any;\n private readonly broadcastConfig?: Config;\n private readonly transportConfig: Config;\n private readonly sender: string;\n private readonly replyTo?: string;\n private readonly cacheTtl: number;\n private readonly concurrencyLimit: number;\n private readonly throttleInterval: number;\n private readonly frontendBaseUrl: string;\n private readonly filter: NotificationProcessorFilters;\n private readonly allowlistEmailAddresses?: string[];\n private readonly denylistEmailAddresses?: string[];\n\n constructor(\n private readonly logger: LoggerService,\n private readonly config: Config,\n private readonly catalog: CatalogService,\n private readonly auth: AuthService,\n private readonly cache?: CacheService,\n private readonly templateRenderer?: NotificationTemplateRenderer,\n ) {\n const emailProcessorConfig = config.getConfig(\n 'notifications.processors.email',\n );\n this.transportConfig = emailProcessorConfig.getConfig('transportConfig');\n this.broadcastConfig =\n emailProcessorConfig.getOptionalConfig('broadcastConfig');\n this.sender = emailProcessorConfig.getString('sender');\n this.replyTo = emailProcessorConfig.getOptionalString('replyTo');\n this.concurrencyLimit =\n emailProcessorConfig.getOptionalNumber('concurrencyLimit') ?? 2;\n this.throttleInterval = emailProcessorConfig.has('throttleInterval')\n ? durationToMilliseconds(\n readDurationFromConfig(emailProcessorConfig, {\n key: 'throttleInterval',\n }),\n )\n : 100;\n this.cacheTtl = emailProcessorConfig.has('cache.ttl')\n ? durationToMilliseconds(\n readDurationFromConfig(emailProcessorConfig, { key: 'cache.ttl' }),\n )\n : 3_600_000;\n this.frontendBaseUrl = config.getString('app.baseUrl');\n this.allowlistEmailAddresses = emailProcessorConfig.getOptionalStringArray(\n 'allowlistEmailAddresses',\n );\n this.denylistEmailAddresses = emailProcessorConfig.getOptionalStringArray(\n 'denylistEmailAddresses',\n );\n this.filter = getProcessorFiltersFromConfig(emailProcessorConfig);\n }\n\n private async getTransporter() {\n if (this.transporter) {\n return this.transporter;\n }\n const transport = this.transportConfig.getString('transport');\n if (transport === 'smtp') {\n this.transporter = createSmtpTransport(this.transportConfig);\n } else if (transport === 'ses') {\n const awsCredentialsManager = DefaultAwsCredentialsManager.fromConfig(\n this.config,\n );\n this.transporter = await createSesTransport(\n this.transportConfig,\n awsCredentialsManager,\n );\n } else if (transport === 'sendmail') {\n this.transporter = createSendmailTransport(this.transportConfig);\n } else if (transport === 'stream') {\n this.transporter = createStreamTransport();\n } else if (transport === 'azure') {\n this.transporter = createAzureTransport(this.transportConfig);\n } else {\n throw new Error(`Unsupported transport: ${transport}`);\n }\n return this.transporter;\n }\n\n getName(): string {\n return 'Email';\n }\n\n private async getBroadcastEmails(): Promise<string[]> {\n if (!this.broadcastConfig) {\n return [];\n }\n\n const receiver = this.broadcastConfig.getString('receiver');\n if (receiver === 'none') {\n return [];\n }\n\n if (receiver === 'config') {\n return (\n this.broadcastConfig.getOptionalStringArray('receiverEmails') ?? []\n );\n }\n\n if (receiver === 'users') {\n const cached = await this.cache?.get<string[]>('user-emails:all');\n if (cached) {\n return cached;\n }\n\n const entities = await this.catalog.getEntities(\n {\n filter: [\n { kind: 'user', 'spec.profile.email': CATALOG_FILTER_EXISTS },\n ],\n fields: ['spec.profile.email'],\n },\n { credentials: await this.auth.getOwnServiceCredentials() },\n );\n const ret = compact([\n ...new Set(\n entities.items.map(entity => {\n return (entity as UserEntity)?.spec.profile?.email;\n }),\n ),\n ]);\n\n await this.cache?.set('user-emails:all', ret, {\n ttl: this.cacheTtl,\n });\n return ret;\n }\n\n throw new Error(`Unsupported broadcast receiver: ${receiver}`);\n }\n\n private async getUserEmail(entityRef: string): Promise<string[]> {\n const cached = await this.cache?.get<string[]>(`user-emails:${entityRef}`);\n if (cached) {\n return cached;\n }\n\n const entity = await this.catalog.getEntityByRef(entityRef, {\n credentials: await this.auth.getOwnServiceCredentials(),\n });\n const ret: string[] = [];\n if (entity) {\n const userEntity = entity as UserEntity;\n if (userEntity.spec.profile?.email) {\n ret.push(userEntity.spec.profile.email);\n }\n }\n\n await this.cache?.set(`user-emails:${entityRef}`, ret, {\n ttl: this.cacheTtl,\n });\n\n return ret;\n }\n\n private async getRecipientEmails(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<string[]> {\n let emails: string[];\n if (options.recipients.type === 'broadcast') {\n emails = await this.getBroadcastEmails();\n } else if (options.recipients.type === 'entity' && !!notification.user) {\n emails = await this.getUserEmail(notification.user);\n } else {\n this.logger.info(\n `Unknown notification type ${options.recipients.type} or missing user.`,\n );\n return [];\n }\n\n if (this.allowlistEmailAddresses) {\n emails = emails.filter(email =>\n this.allowlistEmailAddresses?.includes(email),\n );\n }\n\n if (this.denylistEmailAddresses) {\n emails = emails.filter(\n email => !this.denylistEmailAddresses?.includes(email),\n );\n }\n return emails;\n }\n\n private async sendMail(options: Mail.Options) {\n try {\n this.logger.debug(`Sending notification email to ${options.to}`);\n await this.transporter.sendMail(options);\n } catch (e) {\n this.logger.error(`Failed to send email to ${options.to}: ${e}`);\n }\n }\n\n private async sendMails(options: Mail.Options, emails: string[]) {\n const throttle = pThrottle({\n limit: this.concurrencyLimit,\n interval: this.throttleInterval,\n });\n\n const throttled = throttle((opts: Mail.Options) => this.sendMail(opts));\n await Promise.all(\n emails.map(email => throttled({ ...options, to: email })),\n );\n }\n\n private getNotificationLink(notification: Notification) {\n if (notification.payload.link) {\n const stripLeadingSlash = (s: string) => s.replace(/^\\//, '');\n const ensureTrailingSlash = (s: string) => s.replace(/\\/?$/, '/');\n\n try {\n const url = new URL(\n stripLeadingSlash(notification.payload.link),\n ensureTrailingSlash(this.frontendBaseUrl),\n );\n return url.toString();\n } catch (_e) {\n // noop: fallback to relative URL\n }\n return notification.payload.link;\n }\n return `${this.frontendBaseUrl}/notifications`;\n }\n\n private getHtmlContent(notification: Notification) {\n const contentParts: string[] = [];\n if (notification.payload.description) {\n contentParts.push(`${notification.payload.description}`);\n }\n const link = this.getNotificationLink(notification);\n contentParts.push(`<a href=\"${link}\">${link}</a>`);\n return `<p>${contentParts.join('<br/>')}</p>`;\n }\n\n private getTextContent(notification: Notification) {\n const contentParts: string[] = [];\n if (notification.payload.description) {\n contentParts.push(notification.payload.description);\n }\n contentParts.push(this.getNotificationLink(notification));\n return contentParts.join('\\n\\n');\n }\n\n private async sendPlainEmail(notification: Notification, emails: string[]) {\n const mailOptions = {\n from: this.sender,\n subject: notification.payload.title,\n html: this.getHtmlContent(notification),\n text: this.getTextContent(notification),\n replyTo: this.replyTo,\n };\n\n await this.sendMails(mailOptions, emails);\n }\n\n private async sendTemplateEmail(\n notification: Notification,\n emails: string[],\n ) {\n const mailOptions = {\n from: this.sender,\n subject:\n (await this.templateRenderer?.getSubject?.(notification)) ??\n notification.payload.title,\n html: await this.templateRenderer?.getHtml?.(notification),\n text: await this.templateRenderer?.getText?.(notification),\n replyTo: this.replyTo,\n };\n\n await this.sendMails(mailOptions, emails);\n }\n\n async postProcess(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<void> {\n this.transporter = await this.getTransporter();\n\n let emails: string[] = [];\n try {\n emails = await this.getRecipientEmails(notification, options);\n } catch (e) {\n this.logger.error(`Failed to resolve recipient emails: ${e}`);\n return;\n }\n\n if (emails.length === 0) {\n this.logger.info(\n `No email recipients found for notification: ${notification.id}, skipping`,\n );\n return;\n }\n\n this.logger.debug(`Sending notification emails to: ${emails.join(',')}`);\n\n if (!this.templateRenderer) {\n await this.sendPlainEmail(notification, emails);\n return;\n }\n\n await this.sendTemplateEmail(notification, emails);\n }\n\n getNotificationFilters(): NotificationProcessorFilters {\n return this.filter;\n }\n}\n"],"names":["config","durationToMilliseconds","readDurationFromConfig","getProcessorFiltersFromConfig","createSmtpTransport","DefaultAwsCredentialsManager","createSesTransport","createSendmailTransport","createStreamTransport","createAzureTransport","CATALOG_FILTER_EXISTS","compact","pThrottle"],"mappings":";;;;;;;;;;;;;;;;;;;AAgDO,MAAM,2BAA6D,CAAA;AAAA,EAcxE,YACmB,MACA,EAAAA,QAAA,EACA,OACA,EAAA,IAAA,EACA,OACA,gBACjB,EAAA;AANiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAAA,QAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AACA,IAAA,IAAA,CAAA,gBAAA,GAAA,gBAAA;AAEjB,IAAA,MAAM,uBAAuBA,QAAO,CAAA,SAAA;AAAA,MAClC;AAAA,KACF;AACA,IAAK,IAAA,CAAA,eAA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A,IAAI,SAAmB,EAAC;AACxB,IAAI,IAAA;AACF,MAAA,MAAA,GAAS,MAAM,IAAA,CAAK,kBAAmB,CAAA,YAAA,EAAc,OAAO,CAAA;AAAA,aACrD,CAAG,EAAA;AACV,MAAA,IAAA,CAAK,MAAO,CAAA,KAAA,CAAM,CAAuC,oCAAA,EAAA,CAAC,CAAE,CAAA,CAAA;AAC5D,MAAA;AAAA;AAGF,IAAI,IAAA,MAAA,CAAO,WAAW,CAAG,EAAA;AACvB,MAAA,IAAA,CAAK,MAAO,CAAA,IAAA;AAAA,QACV,CAAA,4CAAA,EAA+C,aAAa,EAAE,CAAA,UAAA;AAAA,OAChE;AACA,MAAA;AAAA;AAGF,IAAA,IAAA,CAAK,OAAO,KAAM,CAAA,CAAA,gCAAA,EAAmC,OAAO,IAAK,CAAA,GAAG,CAAC,CAAE,CAAA,CAAA;AAEvE,IAAI,IAAA,CAAC,KAAK,gBAAkB,EAAA;AAC1B,MAAM,MAAA,IAAA,CAAK,cAAe,CAAA,YAAA,EAAc,MAAM,CAAA;AAC9C,MAAA;AAAA;AAGF,IAAM,MAAA,IAAA,CAAK,iBAAkB,CAAA,YAAA,EAAc,MAAM,CAAA;AAAA;AACnD,EAEA,sBAAuD,GAAA;AACrD,IAAA,OAAO,IAAK,CAAA,MAAA;AAAA;AAEhB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-notifications-backend-module-email",
3
- "version": "0.3.10-next.1",
3
+ "version": "0.3.10-next.2",
4
4
  "description": "The email backend module for the notifications plugin.",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -55,8 +55,8 @@
55
55
  "p-throttle": "^4.1.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@backstage/backend-test-utils": "1.6.0-next.1",
59
- "@backstage/cli": "0.32.2-next.0",
58
+ "@backstage/backend-test-utils": "1.6.0-next.2",
59
+ "@backstage/cli": "0.33.0-next.1",
60
60
  "@types/nodemailer": "^6.4.14"
61
61
  },
62
62
  "configSchema": "config.d.ts",