@logto/connector-aws-ses 1.0.2 → 1.1.0
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/lib/index.js +3 -5
- package/lib/types.d.ts +0 -3
- package/lib/utils.d.ts +3 -2
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectorConfigFormItemType, ConnectorType, validateConfig, ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
|
|
1
|
+
import { ConnectorConfigFormItemType, replaceSendMessageHandlebars, ConnectorType, validateConfig, ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import crypto, { createHash, createHmac } from 'crypto';
|
|
4
4
|
import { homedir, platform, release } from 'os';
|
|
@@ -11273,12 +11273,10 @@ const makeClient = (accessKeyId, secretAccessKey, region) => {
|
|
|
11273
11273
|
const makeEmailContent = (template, payload) => {
|
|
11274
11274
|
return {
|
|
11275
11275
|
Simple: {
|
|
11276
|
-
Subject: { Data: template.subject, Charset: 'utf8' },
|
|
11276
|
+
Subject: { Data: replaceSendMessageHandlebars(template.subject, payload), Charset: 'utf8' },
|
|
11277
11277
|
Body: {
|
|
11278
11278
|
Html: {
|
|
11279
|
-
Data:
|
|
11280
|
-
? template.content.replaceAll('{{code}}', payload.code)
|
|
11281
|
-
: template.content,
|
|
11279
|
+
Data: replaceSendMessageHandlebars(template.content, payload),
|
|
11282
11280
|
},
|
|
11283
11281
|
},
|
|
11284
11282
|
},
|
package/lib/types.d.ts
CHANGED
package/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EmailContent } from '@aws-sdk/client-sesv2';
|
|
2
2
|
import { SendEmailCommand, SESv2Client } from '@aws-sdk/client-sesv2';
|
|
3
|
-
import
|
|
3
|
+
import { type SendMessagePayload } from '@logto/connector-kit';
|
|
4
|
+
import type { AwsSesConfig, Template } from './types.js';
|
|
4
5
|
export declare const makeClient: (accessKeyId: string, secretAccessKey: string, region: string) => SESv2Client;
|
|
5
|
-
export declare const makeEmailContent: (template: Template, payload:
|
|
6
|
+
export declare const makeEmailContent: (template: Template, payload: SendMessagePayload) => EmailContent;
|
|
6
7
|
export declare const makeCommand: (config: AwsSesConfig, emailContent: EmailContent, to: string) => SendEmailCommand;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/connector-aws-ses",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Logto Connector for Amazon SES",
|
|
5
5
|
"author": "Jeff <admin@breadth.app>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@logto/connector-kit": "^2.
|
|
7
|
+
"@logto/connector-kit": "^2.1.0",
|
|
8
8
|
"@aws-sdk/client-sesv2": "^3.224.0",
|
|
9
9
|
"@aws-sdk/types": "^3.226.0"
|
|
10
10
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"logo-dark.svg"
|
|
21
21
|
],
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": "^
|
|
23
|
+
"node": "^20.9.0"
|
|
24
24
|
},
|
|
25
25
|
"eslintConfig": {
|
|
26
26
|
"extends": "@silverhand",
|