@logto/connector-aws-ses 1.0.2 → 1.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/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: typeof payload.code === 'string'
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
@@ -73,7 +73,4 @@ export declare const awsSesConfigGuard: z.ZodObject<{
73
73
  configurationSetName?: string | undefined;
74
74
  }>;
75
75
  export type AwsSesConfig = z.infer<typeof awsSesConfigGuard>;
76
- export type Payload = {
77
- code: string | number;
78
- };
79
76
  export {};
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 type { AwsSesConfig, Template, Payload } from './types.js';
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: Payload) => EmailContent;
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.2",
3
+ "version": "1.1.1",
4
4
  "description": "Logto Connector for Amazon SES",
5
5
  "author": "Jeff <admin@breadth.app>",
6
6
  "dependencies": {
7
- "@logto/connector-kit": "^2.0.0",
7
+ "@logto/connector-kit": "^3.0.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": "^18.12.0"
23
+ "node": "^20.9.0"
24
24
  },
25
25
  "eslintConfig": {
26
26
  "extends": "@silverhand",
@@ -45,8 +45,7 @@
45
45
  "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental",
46
46
  "lint": "eslint --ext .ts src",
47
47
  "lint:report": "pnpm lint --format json --output-file report.json",
48
- "test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
49
- "test": "pnpm build:test && pnpm test:only",
50
- "test:ci": "pnpm test:only --silent --coverage"
48
+ "test": "vitest src",
49
+ "test:ci": "pnpm run test --silent --coverage"
51
50
  }
52
51
  }