vintasend 0.4.0 → 0.4.3

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/README.md CHANGED
@@ -340,20 +340,24 @@ VintaSend has many backend, adapter, and template renderer implementations. If y
340
340
  ##### Backends
341
341
 
342
342
  * **[vintasend-prisma](https://github.com/vintasoftware/vintasend-prisma/)**: Uses Prisma Client to manage the notifications in the database.
343
+ * **[vintasend-medplum](https://github.com/vintasoftware/vintasend-medplum/)**: Uses Medplum FHIR resources (Communication, Binary, Media) to manage notifications in healthcare applications.
343
344
 
344
345
  ##### Adapters
345
346
 
346
347
  * **[vintasend-nodemailer](https://github.com/vintasoftware/vintasend-nodemailer/)**: Uses nodemailer to send transactional emails to users.
348
+ * **[vintasend-medplum](https://github.com/vintasoftware/vintasend-medplum/)**: Uses Medplum's email API to send notifications in healthcare applications.
347
349
 
348
350
  ##### Attachment Managers
349
351
 
350
352
  * **[vintasend-aws-s3-attachments](https://github.com/vintasoftware/vintasend-aws-s3-attachments/)**: AWS S3 storage backend with presigned URLs and streaming support. Also works with S3-compatible services (MinIO, DigitalOcean Spaces, Cloudflare R2, etc.).
353
+ * **[vintasend-medplum](https://github.com/vintasoftware/vintasend-medplum/)**: FHIR-compliant file storage using Binary and Media resources for healthcare applications.
351
354
 
352
355
  ##### Template Renderers
353
356
  * **[vintasend-pug](https://github.com/vintasoftware/vintasend-pug/)**: Renders emails using Pug.
354
357
 
355
358
  ##### Loggers
356
359
  * **[vintasend-winston](https://github.com/vintasoftware/vintasend-winston/)**: Uses Winston to allow `NotificationService` to create log entries.
360
+ * **[vintasend-medplum](https://github.com/vintasoftware/vintasend-medplum/)**: Simple console-based logger for Medplum applications.
357
361
 
358
362
  ## Examples
359
363
 
@@ -57,6 +57,12 @@ class VintaSend {
57
57
  for (const adapter of adapters) {
58
58
  adapter.injectBackend(backend);
59
59
  adapter.injectLogger(logger);
60
+ // Inject logger into template renderer if it supports it
61
+ // biome-ignore lint/suspicious/noExplicitAny: accessing protected templateRenderer property
62
+ const templateRenderer = adapter.templateRenderer;
63
+ if (templateRenderer && typeof templateRenderer.injectLogger === 'function') {
64
+ templateRenderer.injectLogger(logger);
65
+ }
60
66
  }
61
67
  // Inject attachment manager into backend if both exist
62
68
  if (this.attachmentManager && hasAttachmentManagerInjection(backend)) {
@@ -2,6 +2,7 @@ import type { Buffer } from 'node:buffer';
2
2
  import type { JsonObject } from '../../types/json-values';
3
3
  import type { AnyNotification } from '../../types/notification';
4
4
  import type { BaseNotificationTypeConfig } from '../../types/notification-type-config';
5
+ import type { BaseLogger } from '../loggers/base-logger';
5
6
  import type { BaseNotificationTemplateRenderer } from './base-notification-template-renderer';
6
7
  export type Attachment = File | Buffer | string;
7
8
  export type EmailTemplate = {
@@ -10,4 +11,8 @@ export type EmailTemplate = {
10
11
  };
11
12
  export interface BaseEmailTemplateRenderer<Config extends BaseNotificationTypeConfig> extends BaseNotificationTemplateRenderer<Config, EmailTemplate> {
12
13
  render(notification: AnyNotification<Config>, context: JsonObject): Promise<EmailTemplate>;
14
+ /**
15
+ * Inject logger into the template renderer (optional - called by VintaSend when logger exists)
16
+ */
17
+ injectLogger?(logger: BaseLogger): void;
13
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vintasend",
3
- "version": "0.4.0",
3
+ "version": "0.4.3",
4
4
  "main": "dist/index.js",
5
5
  "files": ["dist"],
6
6
  "author": "Hugo Bessa",