@effect-aws/client-ses 1.0.0 → 1.9.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.
Files changed (68) hide show
  1. package/Errors/package.json +6 -0
  2. package/SESClientInstance/package.json +6 -0
  3. package/SESService/package.json +6 -0
  4. package/SESServiceConfig/package.json +6 -0
  5. package/{lib → dist/cjs}/Errors.d.ts +6 -11
  6. package/dist/cjs/Errors.d.ts.map +1 -0
  7. package/dist/cjs/Errors.js +42 -0
  8. package/dist/cjs/Errors.js.map +1 -0
  9. package/dist/cjs/SESClientInstance.d.ts +24 -0
  10. package/dist/cjs/SESClientInstance.d.ts.map +1 -0
  11. package/dist/cjs/SESClientInstance.js +50 -0
  12. package/dist/cjs/SESClientInstance.js.map +1 -0
  13. package/{lib → dist/cjs}/SESService.d.ts +16 -38
  14. package/dist/cjs/SESService.d.ts.map +1 -0
  15. package/dist/cjs/SESService.js +127 -0
  16. package/dist/cjs/SESService.js.map +1 -0
  17. package/dist/cjs/SESServiceConfig.d.ts +25 -0
  18. package/dist/cjs/SESServiceConfig.d.ts.map +1 -0
  19. package/dist/cjs/SESServiceConfig.js +35 -0
  20. package/dist/cjs/SESServiceConfig.js.map +1 -0
  21. package/dist/cjs/index.d.ts +39 -0
  22. package/dist/cjs/index.d.ts.map +1 -0
  23. package/dist/cjs/index.js +56 -0
  24. package/dist/cjs/index.js.map +1 -0
  25. package/dist/dts/Errors.d.ts +41 -0
  26. package/dist/dts/Errors.d.ts.map +1 -0
  27. package/dist/dts/SESClientInstance.d.ts +24 -0
  28. package/dist/dts/SESClientInstance.d.ts.map +1 -0
  29. package/dist/dts/SESService.d.ts +398 -0
  30. package/dist/dts/SESService.d.ts.map +1 -0
  31. package/dist/dts/SESServiceConfig.d.ts +25 -0
  32. package/dist/dts/SESServiceConfig.d.ts.map +1 -0
  33. package/dist/dts/index.d.ts +39 -0
  34. package/dist/dts/index.d.ts.map +1 -0
  35. package/dist/esm/Errors.js +39 -0
  36. package/dist/esm/Errors.js.map +1 -0
  37. package/dist/esm/SESClientInstance.js +23 -0
  38. package/dist/esm/SESClientInstance.js.map +1 -0
  39. package/dist/esm/SESService.js +100 -0
  40. package/dist/esm/SESService.js.map +1 -0
  41. package/dist/esm/SESServiceConfig.js +31 -0
  42. package/dist/esm/SESServiceConfig.js.map +1 -0
  43. package/dist/esm/index.js +27 -0
  44. package/dist/esm/index.js.map +1 -0
  45. package/dist/esm/package.json +4 -0
  46. package/package.json +60 -43
  47. package/src/Errors.ts +119 -0
  48. package/src/SESClientInstance.ts +33 -0
  49. package/src/SESService.ts +1228 -0
  50. package/src/SESServiceConfig.ts +51 -0
  51. package/src/index.ts +44 -0
  52. package/CHANGELOG.md +0 -7
  53. package/docgen.json +0 -8
  54. package/lib/Errors.js +0 -42
  55. package/lib/SESClientInstance.d.ts +0 -31
  56. package/lib/SESClientInstance.js +0 -57
  57. package/lib/SESClientInstanceConfig.d.ts +0 -23
  58. package/lib/SESClientInstanceConfig.js +0 -44
  59. package/lib/SESService.js +0 -159
  60. package/lib/esm/Errors.js +0 -39
  61. package/lib/esm/SESClientInstance.js +0 -30
  62. package/lib/esm/SESClientInstanceConfig.js +0 -40
  63. package/lib/esm/SESService.js +0 -155
  64. package/lib/esm/index.js +0 -5
  65. package/lib/index.d.ts +0 -4
  66. package/lib/index.js +0 -21
  67. package/project.json +0 -77
  68. package/vitest.config.ts +0 -3
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import type { SESClientConfig } from "@aws-sdk/client-ses";
5
+ import { Effect, Layer } from "effect";
6
+ import type { SESService } from "./SESService.js";
7
+ /**
8
+ * @since 1.0.0
9
+ * @category ses service config
10
+ */
11
+ export declare const withSESServiceConfig: {
12
+ (config: SESService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
13
+ <A, E, R>(effect: Effect.Effect<A, E, R>, config: SESService.Config): Effect.Effect<A, E, R>;
14
+ };
15
+ /**
16
+ * @since 1.0.0
17
+ * @category ses service config
18
+ */
19
+ export declare const setSESServiceConfig: (config: SESService.Config) => Layer.Layer<never, never, never>;
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export declare const toSESClientConfig: Effect.Effect<SESClientConfig>;
25
+ //# sourceMappingURL=SESServiceConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SESServiceConfig.d.ts","sourceRoot":"","sources":["../../src/SESServiceConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAY,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE;IACjC,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAK9F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,WAAY,WAAW,MAAM,qCAAyD,CAAC;AAEvH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAQ3D,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SESService } from "./SESService.js";
5
+ /**
6
+ * @since 1.0.0
7
+ */
8
+ export * from "./Errors.js";
9
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as SESClientInstance from "./SESClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as SESServiceConfig from "./SESServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./SESService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias SESService
25
+ */
26
+ export declare namespace SES {
27
+ /**
28
+ * @since 1.0.0
29
+ * @alias SESService.Config
30
+ */
31
+ type Config = SESService.Config;
32
+ }
33
+ /**
34
+ * @since 1.0.0
35
+ * @category exports
36
+ * @alias SESService
37
+ */
38
+ export declare const SES: typeof SESService;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,cAAc,iBAAiB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,GAAG,CAAC;IAC3B;;;OAGG;IACH,KAAY,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,GAAG,mBAAa,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
2
+ export const AllServiceErrors = [
3
+ "AccountSendingPausedException",
4
+ "AlreadyExistsException",
5
+ "CannotDeleteException",
6
+ "ConfigurationSetAlreadyExistsException",
7
+ "ConfigurationSetDoesNotExistException",
8
+ "ConfigurationSetSendingPausedException",
9
+ "CustomVerificationEmailInvalidContentException",
10
+ "CustomVerificationEmailTemplateAlreadyExistsException",
11
+ "CustomVerificationEmailTemplateDoesNotExistException",
12
+ "EventDestinationAlreadyExistsException",
13
+ "EventDestinationDoesNotExistException",
14
+ "FromEmailAddressNotVerifiedException",
15
+ "InvalidCloudWatchDestinationException",
16
+ "InvalidConfigurationSetException",
17
+ "InvalidDeliveryOptionsException",
18
+ "InvalidFirehoseDestinationException",
19
+ "InvalidLambdaFunctionException",
20
+ "InvalidPolicyException",
21
+ "InvalidRenderingParameterException",
22
+ "InvalidS3ConfigurationException",
23
+ "InvalidSNSDestinationException",
24
+ "InvalidSnsTopicException",
25
+ "InvalidTemplateException",
26
+ "InvalidTrackingOptionsException",
27
+ "LimitExceededException",
28
+ "MailFromDomainNotVerifiedException",
29
+ "MessageRejected",
30
+ "MissingRenderingAttributeException",
31
+ "ProductionAccessNotGrantedException",
32
+ "RuleDoesNotExistException",
33
+ "RuleSetDoesNotExistException",
34
+ "TemplateDoesNotExistException",
35
+ "TrackingOptionsAlreadyExistsException",
36
+ "TrackingOptionsDoesNotExistException",
37
+ ];
38
+ export const SdkError = CommonSdkError;
39
+ //# sourceMappingURL=Errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,+BAA+B;IAC/B,wBAAwB;IACxB,uBAAuB;IACvB,wCAAwC;IACxC,uCAAuC;IACvC,wCAAwC;IACxC,gDAAgD;IAChD,uDAAuD;IACvD,sDAAsD;IACtD,wCAAwC;IACxC,uCAAuC;IACvC,sCAAsC;IACtC,uCAAuC;IACvC,kCAAkC;IAClC,iCAAiC;IACjC,qCAAqC;IACrC,gCAAgC;IAChC,wBAAwB;IACxB,oCAAoC;IACpC,iCAAiC;IACjC,gCAAgC;IAChC,0BAA0B;IAC1B,0BAA0B;IAC1B,iCAAiC;IACjC,wBAAwB;IACxB,oCAAoC;IACpC,iBAAiB;IACjB,oCAAoC;IACpC,qCAAqC;IACrC,2BAA2B;IAC3B,8BAA8B;IAC9B,+BAA+B;IAC/B,uCAAuC;IACvC,sCAAsC;CAC9B,CAAC;AA4CX,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SESClient } from "@aws-sdk/client-ses";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as SESServiceConfig from "./SESServiceConfig.js";
7
+ /**
8
+ * @since 1.0.0
9
+ * @category tags
10
+ */
11
+ export class SESClientInstance extends Context.Tag("@effect-aws/client-ses/SESClientInstance")() {
12
+ }
13
+ /**
14
+ * @since 1.0.0
15
+ * @category constructors
16
+ */
17
+ export const make = Effect.flatMap(SESServiceConfig.toSESClientConfig, (config) => Effect.acquireRelease(Effect.sync(() => new SESClient(config)), (client) => Effect.sync(() => client.destroy())));
18
+ /**
19
+ * @since 1.0.0
20
+ * @category layers
21
+ */
22
+ export const layer = Layer.scoped(SESClientInstance, make);
23
+ //# sourceMappingURL=SESClientInstance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SESClientInstance.js","sourceRoot":"","sources":["../../src/SESClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO,CAAC,GAAG,CAChD,0CAA0C,CAC3C,EAAgC;CAAG;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,gBAAgB,CAAC,iBAAiB,EAClC,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EACxC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAChD,CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { CloneReceiptRuleSetCommand, CreateConfigurationSetCommand, CreateConfigurationSetEventDestinationCommand, CreateConfigurationSetTrackingOptionsCommand, CreateCustomVerificationEmailTemplateCommand, CreateReceiptFilterCommand, CreateReceiptRuleCommand, CreateReceiptRuleSetCommand, CreateTemplateCommand, DeleteConfigurationSetCommand, DeleteConfigurationSetEventDestinationCommand, DeleteConfigurationSetTrackingOptionsCommand, DeleteCustomVerificationEmailTemplateCommand, DeleteIdentityCommand, DeleteIdentityPolicyCommand, DeleteReceiptFilterCommand, DeleteReceiptRuleCommand, DeleteReceiptRuleSetCommand, DeleteTemplateCommand, DeleteVerifiedEmailAddressCommand, DescribeActiveReceiptRuleSetCommand, DescribeConfigurationSetCommand, DescribeReceiptRuleCommand, DescribeReceiptRuleSetCommand, GetAccountSendingEnabledCommand, GetCustomVerificationEmailTemplateCommand, GetIdentityDkimAttributesCommand, GetIdentityMailFromDomainAttributesCommand, GetIdentityNotificationAttributesCommand, GetIdentityPoliciesCommand, GetIdentityVerificationAttributesCommand, GetSendQuotaCommand, GetSendStatisticsCommand, GetTemplateCommand, ListConfigurationSetsCommand, ListCustomVerificationEmailTemplatesCommand, ListIdentitiesCommand, ListIdentityPoliciesCommand, ListReceiptFiltersCommand, ListReceiptRuleSetsCommand, ListTemplatesCommand, ListVerifiedEmailAddressesCommand, PutConfigurationSetDeliveryOptionsCommand, PutIdentityPolicyCommand, ReorderReceiptRuleSetCommand, SendBounceCommand, SendBulkTemplatedEmailCommand, SendCustomVerificationEmailCommand, SendEmailCommand, SendRawEmailCommand, SendTemplatedEmailCommand, SetActiveReceiptRuleSetCommand, SetIdentityDkimEnabledCommand, SetIdentityFeedbackForwardingEnabledCommand, SetIdentityHeadersInNotificationsEnabledCommand, SetIdentityMailFromDomainCommand, SetIdentityNotificationTopicCommand, SetReceiptRulePositionCommand, TestRenderTemplateCommand, UpdateAccountSendingEnabledCommand, UpdateConfigurationSetEventDestinationCommand, UpdateConfigurationSetReputationMetricsEnabledCommand, UpdateConfigurationSetSendingEnabledCommand, UpdateConfigurationSetTrackingOptionsCommand, UpdateCustomVerificationEmailTemplateCommand, UpdateReceiptRuleCommand, UpdateTemplateCommand, VerifyDomainDkimCommand, VerifyDomainIdentityCommand, VerifyEmailAddressCommand, VerifyEmailIdentityCommand, } from "@aws-sdk/client-ses";
5
+ import { Service } from "@effect-aws/commons";
6
+ import { Effect, Layer } from "effect";
7
+ import { AllServiceErrors } from "./Errors.js";
8
+ import * as Instance from "./SESClientInstance.js";
9
+ import * as SESServiceConfig from "./SESServiceConfig.js";
10
+ const commands = {
11
+ CloneReceiptRuleSetCommand,
12
+ CreateConfigurationSetCommand,
13
+ CreateConfigurationSetEventDestinationCommand,
14
+ CreateConfigurationSetTrackingOptionsCommand,
15
+ CreateCustomVerificationEmailTemplateCommand,
16
+ CreateReceiptFilterCommand,
17
+ CreateReceiptRuleCommand,
18
+ CreateReceiptRuleSetCommand,
19
+ CreateTemplateCommand,
20
+ DeleteConfigurationSetCommand,
21
+ DeleteConfigurationSetEventDestinationCommand,
22
+ DeleteConfigurationSetTrackingOptionsCommand,
23
+ DeleteCustomVerificationEmailTemplateCommand,
24
+ DeleteIdentityCommand,
25
+ DeleteIdentityPolicyCommand,
26
+ DeleteReceiptFilterCommand,
27
+ DeleteReceiptRuleCommand,
28
+ DeleteReceiptRuleSetCommand,
29
+ DeleteTemplateCommand,
30
+ DeleteVerifiedEmailAddressCommand,
31
+ DescribeActiveReceiptRuleSetCommand,
32
+ DescribeConfigurationSetCommand,
33
+ DescribeReceiptRuleCommand,
34
+ DescribeReceiptRuleSetCommand,
35
+ GetAccountSendingEnabledCommand,
36
+ GetCustomVerificationEmailTemplateCommand,
37
+ GetIdentityDkimAttributesCommand,
38
+ GetIdentityMailFromDomainAttributesCommand,
39
+ GetIdentityNotificationAttributesCommand,
40
+ GetIdentityPoliciesCommand,
41
+ GetIdentityVerificationAttributesCommand,
42
+ GetSendQuotaCommand,
43
+ GetSendStatisticsCommand,
44
+ GetTemplateCommand,
45
+ ListConfigurationSetsCommand,
46
+ ListCustomVerificationEmailTemplatesCommand,
47
+ ListIdentitiesCommand,
48
+ ListIdentityPoliciesCommand,
49
+ ListReceiptFiltersCommand,
50
+ ListReceiptRuleSetsCommand,
51
+ ListTemplatesCommand,
52
+ ListVerifiedEmailAddressesCommand,
53
+ PutConfigurationSetDeliveryOptionsCommand,
54
+ PutIdentityPolicyCommand,
55
+ ReorderReceiptRuleSetCommand,
56
+ SendBounceCommand,
57
+ SendBulkTemplatedEmailCommand,
58
+ SendCustomVerificationEmailCommand,
59
+ SendEmailCommand,
60
+ SendRawEmailCommand,
61
+ SendTemplatedEmailCommand,
62
+ SetActiveReceiptRuleSetCommand,
63
+ SetIdentityDkimEnabledCommand,
64
+ SetIdentityFeedbackForwardingEnabledCommand,
65
+ SetIdentityHeadersInNotificationsEnabledCommand,
66
+ SetIdentityMailFromDomainCommand,
67
+ SetIdentityNotificationTopicCommand,
68
+ SetReceiptRulePositionCommand,
69
+ TestRenderTemplateCommand,
70
+ UpdateAccountSendingEnabledCommand,
71
+ UpdateConfigurationSetEventDestinationCommand,
72
+ UpdateConfigurationSetReputationMetricsEnabledCommand,
73
+ UpdateConfigurationSetSendingEnabledCommand,
74
+ UpdateConfigurationSetTrackingOptionsCommand,
75
+ UpdateCustomVerificationEmailTemplateCommand,
76
+ UpdateReceiptRuleCommand,
77
+ UpdateTemplateCommand,
78
+ VerifyDomainDkimCommand,
79
+ VerifyDomainIdentityCommand,
80
+ VerifyEmailAddressCommand,
81
+ VerifyEmailIdentityCommand,
82
+ };
83
+ /**
84
+ * @since 1.0.0
85
+ * @category constructors
86
+ */
87
+ export const makeSESService = Effect.gen(function* () {
88
+ const client = yield* Instance.SESClientInstance;
89
+ return Service.fromClientAndCommands(client, commands, AllServiceErrors);
90
+ });
91
+ /**
92
+ * @since 1.0.0
93
+ * @category models
94
+ */
95
+ export class SESService extends Effect.Tag("@effect-aws/client-ses/SESService")() {
96
+ static defaultLayer = Layer.effect(this, makeSESService).pipe(Layer.provide(Instance.layer));
97
+ static layer = (config) => Layer.effect(this, makeSESService).pipe(Layer.provide(Instance.layer), Layer.provide(SESServiceConfig.setSESServiceConfig(config)));
98
+ static baseLayer = (evaluate) => Layer.effect(this, makeSESService).pipe(Layer.provide(Layer.effect(Instance.SESClientInstance, Effect.map(SESServiceConfig.toSESClientConfig, evaluate))));
99
+ }
100
+ //# sourceMappingURL=SESService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SESService.js","sourceRoot":"","sources":["../../src/SESService.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,31 @@
1
+ import { ServiceLogger } from "@effect-aws/commons";
2
+ import { Effect, FiberRef, Layer } from "effect";
3
+ import { dual } from "effect/Function";
4
+ import { globalValue } from "effect/GlobalValue";
5
+ /**
6
+ * @since 1.0.0
7
+ * @category ses service config
8
+ */
9
+ const currentSESServiceConfig = globalValue("@effect-aws/client-ses/currentSESServiceConfig", () => FiberRef.unsafeMake({}));
10
+ /**
11
+ * @since 1.0.0
12
+ * @category ses service config
13
+ */
14
+ export const withSESServiceConfig = dual(2, (effect, config) => Effect.locally(effect, currentSESServiceConfig, config));
15
+ /**
16
+ * @since 1.0.0
17
+ * @category ses service config
18
+ */
19
+ export const setSESServiceConfig = (config) => Layer.locallyScoped(currentSESServiceConfig, config);
20
+ /**
21
+ * @since 1.0.0
22
+ * @category adapters
23
+ */
24
+ export const toSESClientConfig = Effect.gen(function* () {
25
+ const { logger: serviceLogger, ...config } = yield* FiberRef.get(currentSESServiceConfig);
26
+ const logger = serviceLogger === true
27
+ ? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
28
+ : (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
29
+ return { logger, ...config };
30
+ });
31
+ //# sourceMappingURL=SESServiceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SESServiceConfig.js","sourceRoot":"","sources":["../../src/SESServiceConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;;GAGG;AACH,MAAM,uBAAuB,GAAG,WAAW,CACzC,gDAAgD,EAChD,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAoB,EAAE,CAAC,CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAG7B,IAAI,CACN,CAAC,EACD,CAAU,MAA8B,EAAE,MAAyB,EAA0B,EAAE,CAC7F,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,CAC1D,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAyB,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AAEvH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAmC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACnF,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAE1F,MAAM,MAAM,GAAG,aAAa,KAAK,IAAI;QACnC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,oBAAoB,CAAC;QACzE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SESService } from "./SESService.js";
5
+ /**
6
+ * @since 1.0.0
7
+ */
8
+ export * from "./Errors.js";
9
+ /**
10
+ * @since 1.0.0
11
+ */
12
+ export * as SESClientInstance from "./SESClientInstance.js";
13
+ /**
14
+ * @since 1.0.0
15
+ */
16
+ export * as SESServiceConfig from "./SESServiceConfig.js";
17
+ /**
18
+ * @since 1.0.0
19
+ */
20
+ export * from "./SESService.js";
21
+ /**
22
+ * @since 1.0.0
23
+ * @category exports
24
+ * @alias SESService
25
+ */
26
+ export const SES = SESService;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,cAAc,iBAAiB,CAAC;AAehC;;;;GAIG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": []
4
+ }
package/package.json CHANGED
@@ -1,54 +1,71 @@
1
1
  {
2
2
  "name": "@effect-aws/client-ses",
3
+ "version": "1.9.0",
4
+ "description": "Effectful AWS SES client",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "github:floydspace/effect-aws",
9
+ "directory": "packages/client-ses"
10
+ },
11
+ "sideEffects": [],
3
12
  "author": {
4
13
  "name": "Victor Korzunin",
5
- "email": "ifloydrose@gmail.com",
6
- "organization": false
14
+ "email": "ifloydrose@gmail.com"
7
15
  },
8
- "devDependencies": {
9
- "@types/node": "^18",
10
- "@typescript-eslint/eslint-plugin": "^7",
11
- "@typescript-eslint/parser": "^7",
12
- "aws-sdk-client-mock": "^4.0.2",
13
- "aws-sdk-client-mock-vitest": "^4.0.0",
14
- "effect": "3.0.0",
15
- "eslint": "^8",
16
- "eslint-config-prettier": "^9.1.0",
17
- "eslint-import-resolver-typescript": "^3.6.1",
18
- "eslint-plugin-import": "^2.29.1",
19
- "eslint-plugin-prettier": "^5.2.1",
20
- "prettier": "^3.2.5",
21
- "typescript": "^5.4.2",
22
- "vitest": "^2.0.5"
16
+ "homepage": "https://floydspace.github.io/effect-aws/docs/client-ses",
17
+ "dependencies": {
18
+ "@aws-sdk/client-ses": "^3",
19
+ "@effect-aws/commons": "^0.1.0"
23
20
  },
24
21
  "peerDependencies": {
25
- "effect": ">=3.0.0 <4.0.0"
22
+ "effect": ">=3.0.4 <4.0.0"
26
23
  },
27
- "dependencies": {
28
- "@aws-sdk/client-ses": "^3"
29
- },
30
- "main": "lib/index.js",
31
- "license": "MIT",
32
- "homepage": "https://floydspace.github.io/effect-aws",
33
- "publishConfig": {
34
- "access": "public"
24
+ "main": "./dist/cjs/index.js",
25
+ "module": "./dist/esm/index.js",
26
+ "types": "./dist/dts/index.d.ts",
27
+ "exports": {
28
+ "./package.json": "./package.json",
29
+ ".": {
30
+ "types": "./dist/dts/index.d.ts",
31
+ "import": "./dist/esm/index.js",
32
+ "default": "./dist/cjs/index.js"
33
+ },
34
+ "./Errors": {
35
+ "types": "./dist/dts/Errors.d.ts",
36
+ "import": "./dist/esm/Errors.js",
37
+ "default": "./dist/cjs/Errors.js"
38
+ },
39
+ "./SESClientInstance": {
40
+ "types": "./dist/dts/SESClientInstance.d.ts",
41
+ "import": "./dist/esm/SESClientInstance.js",
42
+ "default": "./dist/cjs/SESClientInstance.js"
43
+ },
44
+ "./SESService": {
45
+ "types": "./dist/dts/SESService.d.ts",
46
+ "import": "./dist/esm/SESService.js",
47
+ "default": "./dist/cjs/SESService.js"
48
+ },
49
+ "./SESServiceConfig": {
50
+ "types": "./dist/dts/SESServiceConfig.d.ts",
51
+ "import": "./dist/esm/SESServiceConfig.js",
52
+ "default": "./dist/cjs/SESServiceConfig.js"
53
+ }
35
54
  },
36
- "version": "1.0.0",
37
- "types": "lib/index.d.ts",
38
- "module": "lib/esm/index.js",
39
- "sideEffects": [],
40
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\".",
41
- "scripts": {
42
- "build": "npx projen build",
43
- "compile": "npx projen compile",
44
- "default": "npx projen default",
45
- "eslint": "npx projen eslint",
46
- "package": "npx projen package",
47
- "post-compile": "npx projen post-compile",
48
- "pre-compile": "npx projen pre-compile",
49
- "test": "npx projen test",
50
- "test:watch": "npx projen test:watch",
51
- "watch": "npx projen watch",
52
- "docgen": "docgen"
55
+ "typesVersions": {
56
+ "*": {
57
+ "Errors": [
58
+ "./dist/dts/Errors.d.ts"
59
+ ],
60
+ "SESClientInstance": [
61
+ "./dist/dts/SESClientInstance.d.ts"
62
+ ],
63
+ "SESService": [
64
+ "./dist/dts/SESService.d.ts"
65
+ ],
66
+ "SESServiceConfig": [
67
+ "./dist/dts/SESServiceConfig.d.ts"
68
+ ]
69
+ }
53
70
  }
54
71
  }
package/src/Errors.ts ADDED
@@ -0,0 +1,119 @@
1
+ import type {
2
+ AccountSendingPausedException,
3
+ AlreadyExistsException,
4
+ CannotDeleteException,
5
+ ConfigurationSetAlreadyExistsException,
6
+ ConfigurationSetDoesNotExistException,
7
+ ConfigurationSetSendingPausedException,
8
+ CustomVerificationEmailInvalidContentException,
9
+ CustomVerificationEmailTemplateAlreadyExistsException,
10
+ CustomVerificationEmailTemplateDoesNotExistException,
11
+ EventDestinationAlreadyExistsException,
12
+ EventDestinationDoesNotExistException,
13
+ FromEmailAddressNotVerifiedException,
14
+ InvalidCloudWatchDestinationException,
15
+ InvalidConfigurationSetException,
16
+ InvalidDeliveryOptionsException,
17
+ InvalidFirehoseDestinationException,
18
+ InvalidLambdaFunctionException,
19
+ InvalidPolicyException,
20
+ InvalidRenderingParameterException,
21
+ InvalidS3ConfigurationException,
22
+ InvalidSNSDestinationException,
23
+ InvalidSnsTopicException,
24
+ InvalidTemplateException,
25
+ InvalidTrackingOptionsException,
26
+ LimitExceededException,
27
+ MailFromDomainNotVerifiedException,
28
+ MessageRejected,
29
+ MissingRenderingAttributeException,
30
+ ProductionAccessNotGrantedException,
31
+ RuleDoesNotExistException,
32
+ RuleSetDoesNotExistException,
33
+ TemplateDoesNotExistException,
34
+ TrackingOptionsAlreadyExistsException,
35
+ TrackingOptionsDoesNotExistException,
36
+ } from "@aws-sdk/client-ses";
37
+ import type { TaggedException } from "@effect-aws/commons";
38
+ import { SdkError as CommonSdkError } from "@effect-aws/commons";
39
+
40
+ export const AllServiceErrors = [
41
+ "AccountSendingPausedException",
42
+ "AlreadyExistsException",
43
+ "CannotDeleteException",
44
+ "ConfigurationSetAlreadyExistsException",
45
+ "ConfigurationSetDoesNotExistException",
46
+ "ConfigurationSetSendingPausedException",
47
+ "CustomVerificationEmailInvalidContentException",
48
+ "CustomVerificationEmailTemplateAlreadyExistsException",
49
+ "CustomVerificationEmailTemplateDoesNotExistException",
50
+ "EventDestinationAlreadyExistsException",
51
+ "EventDestinationDoesNotExistException",
52
+ "FromEmailAddressNotVerifiedException",
53
+ "InvalidCloudWatchDestinationException",
54
+ "InvalidConfigurationSetException",
55
+ "InvalidDeliveryOptionsException",
56
+ "InvalidFirehoseDestinationException",
57
+ "InvalidLambdaFunctionException",
58
+ "InvalidPolicyException",
59
+ "InvalidRenderingParameterException",
60
+ "InvalidS3ConfigurationException",
61
+ "InvalidSNSDestinationException",
62
+ "InvalidSnsTopicException",
63
+ "InvalidTemplateException",
64
+ "InvalidTrackingOptionsException",
65
+ "LimitExceededException",
66
+ "MailFromDomainNotVerifiedException",
67
+ "MessageRejected",
68
+ "MissingRenderingAttributeException",
69
+ "ProductionAccessNotGrantedException",
70
+ "RuleDoesNotExistException",
71
+ "RuleSetDoesNotExistException",
72
+ "TemplateDoesNotExistException",
73
+ "TrackingOptionsAlreadyExistsException",
74
+ "TrackingOptionsDoesNotExistException",
75
+ ] as const;
76
+
77
+ export type AccountSendingPausedError = TaggedException<AccountSendingPausedException>;
78
+ export type AlreadyExistsError = TaggedException<AlreadyExistsException>;
79
+ export type CannotDeleteError = TaggedException<CannotDeleteException>;
80
+ export type ConfigurationSetAlreadyExistsError = TaggedException<ConfigurationSetAlreadyExistsException>;
81
+ export type ConfigurationSetDoesNotExistError = TaggedException<ConfigurationSetDoesNotExistException>;
82
+ export type ConfigurationSetSendingPausedError = TaggedException<ConfigurationSetSendingPausedException>;
83
+ export type CustomVerificationEmailInvalidContentError = TaggedException<
84
+ CustomVerificationEmailInvalidContentException
85
+ >;
86
+ export type CustomVerificationEmailTemplateAlreadyExistsError = TaggedException<
87
+ CustomVerificationEmailTemplateAlreadyExistsException
88
+ >;
89
+ export type CustomVerificationEmailTemplateDoesNotExistError = TaggedException<
90
+ CustomVerificationEmailTemplateDoesNotExistException
91
+ >;
92
+ export type EventDestinationAlreadyExistsError = TaggedException<EventDestinationAlreadyExistsException>;
93
+ export type EventDestinationDoesNotExistError = TaggedException<EventDestinationDoesNotExistException>;
94
+ export type FromEmailAddressNotVerifiedError = TaggedException<FromEmailAddressNotVerifiedException>;
95
+ export type InvalidCloudWatchDestinationError = TaggedException<InvalidCloudWatchDestinationException>;
96
+ export type InvalidConfigurationSetError = TaggedException<InvalidConfigurationSetException>;
97
+ export type InvalidDeliveryOptionsError = TaggedException<InvalidDeliveryOptionsException>;
98
+ export type InvalidFirehoseDestinationError = TaggedException<InvalidFirehoseDestinationException>;
99
+ export type InvalidLambdaFunctionError = TaggedException<InvalidLambdaFunctionException>;
100
+ export type InvalidPolicyError = TaggedException<InvalidPolicyException>;
101
+ export type InvalidRenderingParameterError = TaggedException<InvalidRenderingParameterException>;
102
+ export type InvalidS3ConfigurationError = TaggedException<InvalidS3ConfigurationException>;
103
+ export type InvalidSNSDestinationError = TaggedException<InvalidSNSDestinationException>;
104
+ export type InvalidSnsTopicError = TaggedException<InvalidSnsTopicException>;
105
+ export type InvalidTemplateError = TaggedException<InvalidTemplateException>;
106
+ export type InvalidTrackingOptionsError = TaggedException<InvalidTrackingOptionsException>;
107
+ export type LimitExceededError = TaggedException<LimitExceededException>;
108
+ export type MailFromDomainNotVerifiedError = TaggedException<MailFromDomainNotVerifiedException>;
109
+ export type MessageRejectedError = TaggedException<MessageRejected>;
110
+ export type MissingRenderingAttributeError = TaggedException<MissingRenderingAttributeException>;
111
+ export type ProductionAccessNotGrantedError = TaggedException<ProductionAccessNotGrantedException>;
112
+ export type RuleDoesNotExistError = TaggedException<RuleDoesNotExistException>;
113
+ export type RuleSetDoesNotExistError = TaggedException<RuleSetDoesNotExistException>;
114
+ export type TemplateDoesNotExistError = TaggedException<TemplateDoesNotExistException>;
115
+ export type TrackingOptionsAlreadyExistsError = TaggedException<TrackingOptionsAlreadyExistsException>;
116
+ export type TrackingOptionsDoesNotExistError = TaggedException<TrackingOptionsDoesNotExistException>;
117
+
118
+ export type SdkError = CommonSdkError;
119
+ export const SdkError = CommonSdkError;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ import { SESClient } from "@aws-sdk/client-ses";
5
+ import { Context, Effect, Layer } from "effect";
6
+ import * as SESServiceConfig from "./SESServiceConfig.js";
7
+
8
+ /**
9
+ * @since 1.0.0
10
+ * @category tags
11
+ */
12
+ export class SESClientInstance extends Context.Tag(
13
+ "@effect-aws/client-ses/SESClientInstance",
14
+ )<SESClientInstance, SESClient>() {}
15
+
16
+ /**
17
+ * @since 1.0.0
18
+ * @category constructors
19
+ */
20
+ export const make = Effect.flatMap(
21
+ SESServiceConfig.toSESClientConfig,
22
+ (config) =>
23
+ Effect.acquireRelease(
24
+ Effect.sync(() => new SESClient(config)),
25
+ (client) => Effect.sync(() => client.destroy()),
26
+ ),
27
+ );
28
+
29
+ /**
30
+ * @since 1.0.0
31
+ * @category layers
32
+ */
33
+ export const layer = Layer.scoped(SESClientInstance, make);