effortless-aws 0.14.3 → 0.16.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.
@@ -255,6 +255,33 @@ var createBucketClient = (bucketName) => {
255
255
  import { readFileSync } from "fs";
256
256
  import { join } from "path";
257
257
 
258
+ // src/runtime/email-client.ts
259
+ import { SESv2Client, SendEmailCommand } from "@aws-sdk/client-sesv2";
260
+ var createEmailClient = () => {
261
+ let client2 = null;
262
+ const getClient2 = () => client2 ??= new SESv2Client({});
263
+ return {
264
+ async send({ from, to, subject, html, text }) {
265
+ const toAddresses = Array.isArray(to) ? to : [to];
266
+ await getClient2().send(
267
+ new SendEmailCommand({
268
+ FromEmailAddress: from,
269
+ Destination: { ToAddresses: toAddresses },
270
+ Content: {
271
+ Simple: {
272
+ Subject: { Data: subject },
273
+ Body: {
274
+ ...html ? { Html: { Data: html } } : {},
275
+ ...text ? { Text: { Data: text } } : {}
276
+ }
277
+ }
278
+ }
279
+ })
280
+ );
281
+ }
282
+ };
283
+ };
284
+
258
285
  // src/runtime/ssm-client.ts
259
286
  import { SSM } from "@aws-sdk/client-ssm";
260
287
  var client = null;
@@ -291,7 +318,8 @@ var DEP_FACTORIES = {
291
318
  const tagField = depHandler?.__spec?.tagField;
292
319
  return createTableClient(name, tagField ? { tagField } : void 0);
293
320
  },
294
- bucket: (name) => createBucketClient(name)
321
+ bucket: (name) => createBucketClient(name),
322
+ mailer: () => createEmailClient()
295
323
  };
296
324
  var parseDepValue = (raw) => {
297
325
  const idx = raw.indexOf(":");