vintasend-pug 0.1.0 → 0.1.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vintasend-pug",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"pug": "^3.0.3",
|
|
13
|
-
"vintasend": "^0.1.
|
|
13
|
+
"vintasend": "^0.1.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/pug": "^2.0.10"
|
|
@@ -5,16 +5,20 @@ import type {
|
|
|
5
5
|
} from 'vintasend/src/services/notification-template-renderers/base-email-template-renderer';
|
|
6
6
|
import type { JsonObject } from 'vintasend/src/types/json-values';
|
|
7
7
|
import type { Notification } from 'vintasend/src/types/notification';
|
|
8
|
+
import type { Identifier } from 'vintasend/src/types/identifier';
|
|
8
9
|
|
|
9
10
|
import pug from 'pug';
|
|
10
11
|
|
|
11
|
-
export class PugEmailTemplateRenderer<
|
|
12
|
-
|
|
12
|
+
export class PugEmailTemplateRenderer<
|
|
13
|
+
AvailableContexts extends Record<string, ContextGenerator>,
|
|
14
|
+
NotificationIdType extends Identifier = Identifier,
|
|
15
|
+
UserIdType extends Identifier = Identifier,
|
|
16
|
+
> implements BaseEmailTemplateRenderer<AvailableContexts, NotificationIdType, UserIdType>
|
|
13
17
|
{
|
|
14
18
|
constructor(private options: pug.Options = {}) {}
|
|
15
19
|
|
|
16
20
|
render(
|
|
17
|
-
notification: Notification<AvailableContexts>,
|
|
21
|
+
notification: Notification<AvailableContexts, NotificationIdType, UserIdType>,
|
|
18
22
|
context: JsonObject,
|
|
19
23
|
): Promise<EmailTemplate> {
|
|
20
24
|
const bodyTemplate = pug.compileFile(notification.bodyTemplate, this.options);
|