@aws-lite/ses 0.0.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/package.json +22 -0
- package/readme.md +162 -0
- package/src/incomplete.mjs +73 -0
- package/src/index.mjs +84 -0
- package/src/lib.mjs +28 -0
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aws-lite/ses",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Official `aws-lite` plugin for SES",
|
|
5
|
+
"homepage": "https://aws-lite.org/services/ses",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/aws-lite/aws-lite.git",
|
|
9
|
+
"directory": "plugins/ses"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/aws-lite/aws-lite/issues",
|
|
12
|
+
"main": "src/index.mjs",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=16"
|
|
15
|
+
},
|
|
16
|
+
"author": "@architect",
|
|
17
|
+
"license": "Apache-2.0",
|
|
18
|
+
"files": [
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {}
|
|
22
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# `@aws-lite/ses`
|
|
2
|
+
|
|
3
|
+
> Official `aws-lite` plugin for SES
|
|
4
|
+
|
|
5
|
+
> Maintained by: [@architect](https://github.com/architect)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm i @aws-lite/ses
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Optionally install types:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm i -D @aws-lite/ses-types
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Reference
|
|
22
|
+
|
|
23
|
+
[Reference documentation with examples at aws-lite.org](https://aws-lite.org/services/ses)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Methods
|
|
27
|
+
|
|
28
|
+
<!-- ! Do not remove METHOD_DOCS_START / METHOD_DOCS_END ! -->
|
|
29
|
+
<!-- METHOD_DOCS_START -->
|
|
30
|
+
### `SendEmail`
|
|
31
|
+
|
|
32
|
+
[Canonical AWS API doc](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendEmail.html)
|
|
33
|
+
|
|
34
|
+
Properties:
|
|
35
|
+
- **`Source` (string) [required]**
|
|
36
|
+
- Email address that is sending the email; must be a verified SES identity
|
|
37
|
+
- **`Destination` (object) [required]**
|
|
38
|
+
- Destination for the email, composed of `ToAddresses`, `CcAddresses`, and `BccAddresses` arrays
|
|
39
|
+
- [More details (AWS)](https://docs.aws.amazon.com/ses/latest/APIReference/API_Destination.html)
|
|
40
|
+
- **`Message` (object) [required]**
|
|
41
|
+
- Message to be sent, composed of a `Subject` and `Body` (with `Text` and/or `Html` parts)
|
|
42
|
+
- [More details (AWS)](https://docs.aws.amazon.com/ses/latest/APIReference/API_Message.html)
|
|
43
|
+
- **`ConfigurationSetName` (string)**
|
|
44
|
+
- Name of the configuration set to use when sending the email
|
|
45
|
+
- **`ReplyToAddresses` (array)**
|
|
46
|
+
- Array of reply-to email addresses
|
|
47
|
+
- **`ReturnPath` (string)**
|
|
48
|
+
- Email address to which bounces and complaints are forwarded when feedback forwarding is enabled
|
|
49
|
+
- **`ReturnPathArn` (string)**
|
|
50
|
+
- ARN of the identity associated with the sending authorization policy permitting use of the `ReturnPath` address
|
|
51
|
+
- **`SourceArn` (string)**
|
|
52
|
+
- ARN of the identity associated with the sending authorization policy permitting use of the `Source` address
|
|
53
|
+
- **`Tags` (array)**
|
|
54
|
+
- Array of `{ Name, Value }` message tags to apply to the email
|
|
55
|
+
- [More details (AWS)](https://docs.aws.amazon.com/ses/latest/APIReference/API_MessageTag.html)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### `SendRawEmail`
|
|
59
|
+
|
|
60
|
+
[Canonical AWS API doc](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendRawEmail.html)
|
|
61
|
+
|
|
62
|
+
Properties:
|
|
63
|
+
- **`RawMessage` (object) [required]**
|
|
64
|
+
- Raw email message, as `{ Data }` where `Data` is the entire base64-encoded MIME message
|
|
65
|
+
- [More details (AWS)](https://docs.aws.amazon.com/ses/latest/APIReference/API_RawMessage.html)
|
|
66
|
+
- **`ConfigurationSetName` (string)**
|
|
67
|
+
- Name of the configuration set to use when sending the email
|
|
68
|
+
- **`Destinations` (array)**
|
|
69
|
+
- Array of destination email addresses (To:, CC:, and BCC:)
|
|
70
|
+
- **`FromArn` (string)**
|
|
71
|
+
- ARN of the identity associated with the sending authorization policy permitting the specified `From` address
|
|
72
|
+
- **`ReturnPathArn` (string)**
|
|
73
|
+
- ARN of the identity associated with the sending authorization policy permitting use of the `ReturnPath` address
|
|
74
|
+
- **`Source` (string)**
|
|
75
|
+
- Identity email address sending the email; if omitted, a `From` address must be present in the raw message
|
|
76
|
+
- **`SourceArn` (string)**
|
|
77
|
+
- ARN of the identity associated with the sending authorization policy permitting use of the `Source` address
|
|
78
|
+
- **`Tags` (array)**
|
|
79
|
+
- Array of `{ Name, Value }` message tags to apply to the email
|
|
80
|
+
- [More details (AWS)](https://docs.aws.amazon.com/ses/latest/APIReference/API_MessageTag.html)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Methods yet to be implemented
|
|
84
|
+
|
|
85
|
+
> Please help out by [opening a PR](https://github.com/aws-lite/aws-lite#authoring-aws-lite-plugins)!
|
|
86
|
+
|
|
87
|
+
- [`CloneReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CloneReceiptRuleSet.html)
|
|
88
|
+
- [`CreateConfigurationSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateConfigurationSet.html)
|
|
89
|
+
- [`CreateConfigurationSetEventDestination`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateConfigurationSetEventDestination.html)
|
|
90
|
+
- [`CreateConfigurationSetTrackingOptions`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateConfigurationSetTrackingOptions.html)
|
|
91
|
+
- [`CreateCustomVerificationEmailTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateCustomVerificationEmailTemplate.html)
|
|
92
|
+
- [`CreateReceiptFilter`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateReceiptFilter.html)
|
|
93
|
+
- [`CreateReceiptRule`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateReceiptRule.html)
|
|
94
|
+
- [`CreateReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateReceiptRuleSet.html)
|
|
95
|
+
- [`CreateTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_CreateTemplate.html)
|
|
96
|
+
- [`DeleteConfigurationSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteConfigurationSet.html)
|
|
97
|
+
- [`DeleteConfigurationSetEventDestination`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteConfigurationSetEventDestination.html)
|
|
98
|
+
- [`DeleteConfigurationSetTrackingOptions`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteConfigurationSetTrackingOptions.html)
|
|
99
|
+
- [`DeleteCustomVerificationEmailTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteCustomVerificationEmailTemplate.html)
|
|
100
|
+
- [`DeleteIdentity`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteIdentity.html)
|
|
101
|
+
- [`DeleteIdentityPolicy`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteIdentityPolicy.html)
|
|
102
|
+
- [`DeleteReceiptFilter`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteReceiptFilter.html)
|
|
103
|
+
- [`DeleteReceiptRule`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteReceiptRule.html)
|
|
104
|
+
- [`DeleteReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteReceiptRuleSet.html)
|
|
105
|
+
- [`DeleteTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteTemplate.html)
|
|
106
|
+
- [`DeleteVerifiedEmailAddress`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DeleteVerifiedEmailAddress.html)
|
|
107
|
+
- [`DescribeActiveReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DescribeActiveReceiptRuleSet.html)
|
|
108
|
+
- [`DescribeConfigurationSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DescribeConfigurationSet.html)
|
|
109
|
+
- [`DescribeReceiptRule`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DescribeReceiptRule.html)
|
|
110
|
+
- [`DescribeReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_DescribeReceiptRuleSet.html)
|
|
111
|
+
- [`GetAccountSendingEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetAccountSendingEnabled.html)
|
|
112
|
+
- [`GetCustomVerificationEmailTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetCustomVerificationEmailTemplate.html)
|
|
113
|
+
- [`GetIdentityDkimAttributes`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityDkimAttributes.html)
|
|
114
|
+
- [`GetIdentityMailFromDomainAttributes`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityMailFromDomainAttributes.html)
|
|
115
|
+
- [`GetIdentityNotificationAttributes`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityNotificationAttributes.html)
|
|
116
|
+
- [`GetIdentityPolicies`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityPolicies.html)
|
|
117
|
+
- [`GetIdentityVerificationAttributes`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetIdentityVerificationAttributes.html)
|
|
118
|
+
- [`GetSendQuota`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetSendQuota.html)
|
|
119
|
+
- [`GetSendStatistics`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetSendStatistics.html)
|
|
120
|
+
- [`GetTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_GetTemplate.html)
|
|
121
|
+
- [`ListConfigurationSets`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListConfigurationSets.html)
|
|
122
|
+
- [`ListCustomVerificationEmailTemplates`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListCustomVerificationEmailTemplates.html)
|
|
123
|
+
- [`ListIdentities`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListIdentities.html)
|
|
124
|
+
- [`ListIdentityPolicies`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListIdentityPolicies.html)
|
|
125
|
+
- [`ListReceiptFilters`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListReceiptFilters.html)
|
|
126
|
+
- [`ListReceiptRuleSets`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListReceiptRuleSets.html)
|
|
127
|
+
- [`ListTemplates`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListTemplates.html)
|
|
128
|
+
- [`ListVerifiedEmailAddresses`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ListVerifiedEmailAddresses.html)
|
|
129
|
+
- [`PutConfigurationSetDeliveryOptions`](https://docs.aws.amazon.com/ses/latest/APIReference/API_PutConfigurationSetDeliveryOptions.html)
|
|
130
|
+
- [`PutIdentityPolicy`](https://docs.aws.amazon.com/ses/latest/APIReference/API_PutIdentityPolicy.html)
|
|
131
|
+
- [`ReorderReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_ReorderReceiptRuleSet.html)
|
|
132
|
+
- [`SendBounce`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendBounce.html)
|
|
133
|
+
- [`SendBulkTemplatedEmail`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendBulkTemplatedEmail.html)
|
|
134
|
+
- [`SendCustomVerificationEmail`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendCustomVerificationEmail.html)
|
|
135
|
+
- [`SendTemplatedEmail`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SendTemplatedEmail.html)
|
|
136
|
+
- [`SetActiveReceiptRuleSet`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetActiveReceiptRuleSet.html)
|
|
137
|
+
- [`SetIdentityDkimEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityDkimEnabled.html)
|
|
138
|
+
- [`SetIdentityFeedbackForwardingEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityFeedbackForwardingEnabled.html)
|
|
139
|
+
- [`SetIdentityHeadersInNotificationsEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityHeadersInNotificationsEnabled.html)
|
|
140
|
+
- [`SetIdentityMailFromDomain`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityMailFromDomain.html)
|
|
141
|
+
- [`SetIdentityNotificationTopic`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetIdentityNotificationTopic.html)
|
|
142
|
+
- [`SetReceiptRulePosition`](https://docs.aws.amazon.com/ses/latest/APIReference/API_SetReceiptRulePosition.html)
|
|
143
|
+
- [`TestRenderTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_TestRenderTemplate.html)
|
|
144
|
+
- [`UpdateAccountSendingEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateAccountSendingEnabled.html)
|
|
145
|
+
- [`UpdateConfigurationSetEventDestination`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateConfigurationSetEventDestination.html)
|
|
146
|
+
- [`UpdateConfigurationSetReputationMetricsEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateConfigurationSetReputationMetricsEnabled.html)
|
|
147
|
+
- [`UpdateConfigurationSetSendingEnabled`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateConfigurationSetSendingEnabled.html)
|
|
148
|
+
- [`UpdateConfigurationSetTrackingOptions`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateConfigurationSetTrackingOptions.html)
|
|
149
|
+
- [`UpdateCustomVerificationEmailTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateCustomVerificationEmailTemplate.html)
|
|
150
|
+
- [`UpdateReceiptRule`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateReceiptRule.html)
|
|
151
|
+
- [`UpdateTemplate`](https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateTemplate.html)
|
|
152
|
+
- [`VerifyDomainDkim`](https://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyDomainDkim.html)
|
|
153
|
+
- [`VerifyDomainIdentity`](https://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyDomainIdentity.html)
|
|
154
|
+
- [`VerifyEmailAddress`](https://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyEmailAddress.html)
|
|
155
|
+
- [`VerifyEmailIdentity`](https://docs.aws.amazon.com/ses/latest/APIReference/API_VerifyEmailIdentity.html)
|
|
156
|
+
<!-- METHOD_DOCS_END -->
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## Learn more
|
|
160
|
+
|
|
161
|
+
- [More information about the `aws-lite` plugin API](https://aws-lite.org/plugin-api)
|
|
162
|
+
- [Learn about contributing to this and other `aws-lite` plugins](https://aws-lite.org/contributing)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const disabled = true
|
|
2
|
+
const docRoot = 'https://docs.aws.amazon.com/ses/latest/APIReference/'
|
|
3
|
+
export default {
|
|
4
|
+
CloneReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_CloneReceiptRuleSet.html' },
|
|
5
|
+
CreateConfigurationSet: { disabled, awsDoc: docRoot + 'API_CreateConfigurationSet.html' },
|
|
6
|
+
CreateConfigurationSetEventDestination: { disabled, awsDoc: docRoot + 'API_CreateConfigurationSetEventDestination.html' },
|
|
7
|
+
CreateConfigurationSetTrackingOptions: { disabled, awsDoc: docRoot + 'API_CreateConfigurationSetTrackingOptions.html' },
|
|
8
|
+
CreateCustomVerificationEmailTemplate: { disabled, awsDoc: docRoot + 'API_CreateCustomVerificationEmailTemplate.html' },
|
|
9
|
+
CreateReceiptFilter: { disabled, awsDoc: docRoot + 'API_CreateReceiptFilter.html' },
|
|
10
|
+
CreateReceiptRule: { disabled, awsDoc: docRoot + 'API_CreateReceiptRule.html' },
|
|
11
|
+
CreateReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_CreateReceiptRuleSet.html' },
|
|
12
|
+
CreateTemplate: { disabled, awsDoc: docRoot + 'API_CreateTemplate.html' },
|
|
13
|
+
DeleteConfigurationSet: { disabled, awsDoc: docRoot + 'API_DeleteConfigurationSet.html' },
|
|
14
|
+
DeleteConfigurationSetEventDestination: { disabled, awsDoc: docRoot + 'API_DeleteConfigurationSetEventDestination.html' },
|
|
15
|
+
DeleteConfigurationSetTrackingOptions: { disabled, awsDoc: docRoot + 'API_DeleteConfigurationSetTrackingOptions.html' },
|
|
16
|
+
DeleteCustomVerificationEmailTemplate: { disabled, awsDoc: docRoot + 'API_DeleteCustomVerificationEmailTemplate.html' },
|
|
17
|
+
DeleteIdentity: { disabled, awsDoc: docRoot + 'API_DeleteIdentity.html' },
|
|
18
|
+
DeleteIdentityPolicy: { disabled, awsDoc: docRoot + 'API_DeleteIdentityPolicy.html' },
|
|
19
|
+
DeleteReceiptFilter: { disabled, awsDoc: docRoot + 'API_DeleteReceiptFilter.html' },
|
|
20
|
+
DeleteReceiptRule: { disabled, awsDoc: docRoot + 'API_DeleteReceiptRule.html' },
|
|
21
|
+
DeleteReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_DeleteReceiptRuleSet.html' },
|
|
22
|
+
DeleteTemplate: { disabled, awsDoc: docRoot + 'API_DeleteTemplate.html' },
|
|
23
|
+
DeleteVerifiedEmailAddress: { disabled, awsDoc: docRoot + 'API_DeleteVerifiedEmailAddress.html' },
|
|
24
|
+
DescribeActiveReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_DescribeActiveReceiptRuleSet.html' },
|
|
25
|
+
DescribeConfigurationSet: { disabled, awsDoc: docRoot + 'API_DescribeConfigurationSet.html' },
|
|
26
|
+
DescribeReceiptRule: { disabled, awsDoc: docRoot + 'API_DescribeReceiptRule.html' },
|
|
27
|
+
DescribeReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_DescribeReceiptRuleSet.html' },
|
|
28
|
+
GetAccountSendingEnabled: { disabled, awsDoc: docRoot + 'API_GetAccountSendingEnabled.html' },
|
|
29
|
+
GetCustomVerificationEmailTemplate: { disabled, awsDoc: docRoot + 'API_GetCustomVerificationEmailTemplate.html' },
|
|
30
|
+
GetIdentityDkimAttributes: { disabled, awsDoc: docRoot + 'API_GetIdentityDkimAttributes.html' },
|
|
31
|
+
GetIdentityMailFromDomainAttributes: { disabled, awsDoc: docRoot + 'API_GetIdentityMailFromDomainAttributes.html' },
|
|
32
|
+
GetIdentityNotificationAttributes: { disabled, awsDoc: docRoot + 'API_GetIdentityNotificationAttributes.html' },
|
|
33
|
+
GetIdentityPolicies: { disabled, awsDoc: docRoot + 'API_GetIdentityPolicies.html' },
|
|
34
|
+
GetIdentityVerificationAttributes: { disabled, awsDoc: docRoot + 'API_GetIdentityVerificationAttributes.html' },
|
|
35
|
+
GetSendQuota: { disabled, awsDoc: docRoot + 'API_GetSendQuota.html' },
|
|
36
|
+
GetSendStatistics: { disabled, awsDoc: docRoot + 'API_GetSendStatistics.html' },
|
|
37
|
+
GetTemplate: { disabled, awsDoc: docRoot + 'API_GetTemplate.html' },
|
|
38
|
+
ListConfigurationSets: { disabled, awsDoc: docRoot + 'API_ListConfigurationSets.html' },
|
|
39
|
+
ListCustomVerificationEmailTemplates: { disabled, awsDoc: docRoot + 'API_ListCustomVerificationEmailTemplates.html' },
|
|
40
|
+
ListIdentities: { disabled, awsDoc: docRoot + 'API_ListIdentities.html' },
|
|
41
|
+
ListIdentityPolicies: { disabled, awsDoc: docRoot + 'API_ListIdentityPolicies.html' },
|
|
42
|
+
ListReceiptFilters: { disabled, awsDoc: docRoot + 'API_ListReceiptFilters.html' },
|
|
43
|
+
ListReceiptRuleSets: { disabled, awsDoc: docRoot + 'API_ListReceiptRuleSets.html' },
|
|
44
|
+
ListTemplates: { disabled, awsDoc: docRoot + 'API_ListTemplates.html' },
|
|
45
|
+
ListVerifiedEmailAddresses: { disabled, awsDoc: docRoot + 'API_ListVerifiedEmailAddresses.html' },
|
|
46
|
+
PutConfigurationSetDeliveryOptions: { disabled, awsDoc: docRoot + 'API_PutConfigurationSetDeliveryOptions.html' },
|
|
47
|
+
PutIdentityPolicy: { disabled, awsDoc: docRoot + 'API_PutIdentityPolicy.html' },
|
|
48
|
+
ReorderReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_ReorderReceiptRuleSet.html' },
|
|
49
|
+
SendBounce: { disabled, awsDoc: docRoot + 'API_SendBounce.html' },
|
|
50
|
+
SendBulkTemplatedEmail: { disabled, awsDoc: docRoot + 'API_SendBulkTemplatedEmail.html' },
|
|
51
|
+
SendCustomVerificationEmail: { disabled, awsDoc: docRoot + 'API_SendCustomVerificationEmail.html' },
|
|
52
|
+
SendTemplatedEmail: { disabled, awsDoc: docRoot + 'API_SendTemplatedEmail.html' },
|
|
53
|
+
SetActiveReceiptRuleSet: { disabled, awsDoc: docRoot + 'API_SetActiveReceiptRuleSet.html' },
|
|
54
|
+
SetIdentityDkimEnabled: { disabled, awsDoc: docRoot + 'API_SetIdentityDkimEnabled.html' },
|
|
55
|
+
SetIdentityFeedbackForwardingEnabled: { disabled, awsDoc: docRoot + 'API_SetIdentityFeedbackForwardingEnabled.html' },
|
|
56
|
+
SetIdentityHeadersInNotificationsEnabled: { disabled, awsDoc: docRoot + 'API_SetIdentityHeadersInNotificationsEnabled.html' },
|
|
57
|
+
SetIdentityMailFromDomain: { disabled, awsDoc: docRoot + 'API_SetIdentityMailFromDomain.html' },
|
|
58
|
+
SetIdentityNotificationTopic: { disabled, awsDoc: docRoot + 'API_SetIdentityNotificationTopic.html' },
|
|
59
|
+
SetReceiptRulePosition: { disabled, awsDoc: docRoot + 'API_SetReceiptRulePosition.html' },
|
|
60
|
+
TestRenderTemplate: { disabled, awsDoc: docRoot + 'API_TestRenderTemplate.html' },
|
|
61
|
+
UpdateAccountSendingEnabled: { disabled, awsDoc: docRoot + 'API_UpdateAccountSendingEnabled.html' },
|
|
62
|
+
UpdateConfigurationSetEventDestination: { disabled, awsDoc: docRoot + 'API_UpdateConfigurationSetEventDestination.html' },
|
|
63
|
+
UpdateConfigurationSetReputationMetricsEnabled: { disabled, awsDoc: docRoot + 'API_UpdateConfigurationSetReputationMetricsEnabled.html' },
|
|
64
|
+
UpdateConfigurationSetSendingEnabled: { disabled, awsDoc: docRoot + 'API_UpdateConfigurationSetSendingEnabled.html' },
|
|
65
|
+
UpdateConfigurationSetTrackingOptions: { disabled, awsDoc: docRoot + 'API_UpdateConfigurationSetTrackingOptions.html' },
|
|
66
|
+
UpdateCustomVerificationEmailTemplate: { disabled, awsDoc: docRoot + 'API_UpdateCustomVerificationEmailTemplate.html' },
|
|
67
|
+
UpdateReceiptRule: { disabled, awsDoc: docRoot + 'API_UpdateReceiptRule.html' },
|
|
68
|
+
UpdateTemplate: { disabled, awsDoc: docRoot + 'API_UpdateTemplate.html' },
|
|
69
|
+
VerifyDomainDkim: { disabled, awsDoc: docRoot + 'API_VerifyDomainDkim.html' },
|
|
70
|
+
VerifyDomainIdentity: { disabled, awsDoc: docRoot + 'API_VerifyDomainIdentity.html' },
|
|
71
|
+
VerifyEmailAddress: { disabled, awsDoc: docRoot + 'API_VerifyEmailAddress.html' },
|
|
72
|
+
VerifyEmailIdentity: { disabled, awsDoc: docRoot + 'API_VerifyEmailIdentity.html' },
|
|
73
|
+
}
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin maintained by: @architect
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import incomplete from './incomplete.mjs'
|
|
6
|
+
import { flattenParams } from './lib.mjs'
|
|
7
|
+
import { default as qs } from 'node:querystring'
|
|
8
|
+
|
|
9
|
+
const service = 'ses'
|
|
10
|
+
const property = 'SES'
|
|
11
|
+
const required = true
|
|
12
|
+
const docRoot = 'https://docs.aws.amazon.com/ses/latest/APIReference/'
|
|
13
|
+
|
|
14
|
+
// Validation types
|
|
15
|
+
const arr = { type: 'array' }
|
|
16
|
+
const obj = { type: 'object' }
|
|
17
|
+
const str = { type: 'string' }
|
|
18
|
+
|
|
19
|
+
const formEncodedContentType = { 'content-type': 'application/x-www-form-urlencoded' }
|
|
20
|
+
|
|
21
|
+
const defaultError = ({ statusCode, headers, error }) => {
|
|
22
|
+
if (error.Error) error = error.Error
|
|
23
|
+
// SDK v2 lowcases `code`
|
|
24
|
+
if (error?.Code) {
|
|
25
|
+
error.name = error.code = error.Code
|
|
26
|
+
delete error.Code
|
|
27
|
+
}
|
|
28
|
+
if (error && (headers?.['x-amzn-requestid'] || headers?.['x-amzn-RequestId'])) {
|
|
29
|
+
error.requestId = headers['x-amzn-requestid'] || headers?.['x-amzn-RequestId']
|
|
30
|
+
}
|
|
31
|
+
return { statusCode, error }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const SendEmail = {
|
|
35
|
+
awsDoc: docRoot + 'API_SendEmail.html',
|
|
36
|
+
validate: {
|
|
37
|
+
Source: { ...str, required, comment: 'Email address that is sending the email; must be a verified SES identity' },
|
|
38
|
+
Destination: { ...obj, required, comment: 'Destination for the email, composed of `ToAddresses`, `CcAddresses`, and `BccAddresses` arrays', ref: docRoot + 'API_Destination.html' },
|
|
39
|
+
Message: { ...obj, required, comment: 'Message to be sent, composed of a `Subject` and `Body` (with `Text` and/or `Html` parts)', ref: docRoot + 'API_Message.html' },
|
|
40
|
+
ConfigurationSetName: { ...str, comment: 'Name of the configuration set to use when sending the email' },
|
|
41
|
+
ReplyToAddresses: { ...arr, comment: 'Array of reply-to email addresses' },
|
|
42
|
+
ReturnPath: { ...str, comment: 'Email address to which bounces and complaints are forwarded when feedback forwarding is enabled' },
|
|
43
|
+
ReturnPathArn: { ...str, comment: 'ARN of the identity associated with the sending authorization policy permitting use of the `ReturnPath` address' },
|
|
44
|
+
SourceArn: { ...str, comment: 'ARN of the identity associated with the sending authorization policy permitting use of the `Source` address' },
|
|
45
|
+
Tags: { ...arr, comment: 'Array of `{ Name, Value }` message tags to apply to the email', ref: docRoot + 'API_MessageTag.html' },
|
|
46
|
+
},
|
|
47
|
+
request: async (params) => ({
|
|
48
|
+
headers: formEncodedContentType,
|
|
49
|
+
payload: qs.stringify(flattenParams({ Action: 'SendEmail', ...params })),
|
|
50
|
+
}),
|
|
51
|
+
response: ({ payload }) => payload.SendEmailResult,
|
|
52
|
+
error: defaultError,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const SendRawEmail = {
|
|
56
|
+
awsDoc: docRoot + 'API_SendRawEmail.html',
|
|
57
|
+
validate: {
|
|
58
|
+
RawMessage: { ...obj, required, comment: 'Raw email message, as `{ Data }` where `Data` is the entire base64-encoded MIME message', ref: docRoot + 'API_RawMessage.html' },
|
|
59
|
+
ConfigurationSetName: { ...str, comment: 'Name of the configuration set to use when sending the email' },
|
|
60
|
+
Destinations: { ...arr, comment: 'Array of destination email addresses (To:, CC:, and BCC:)' },
|
|
61
|
+
FromArn: { ...str, comment: 'ARN of the identity associated with the sending authorization policy permitting the specified `From` address' },
|
|
62
|
+
ReturnPathArn: { ...str, comment: 'ARN of the identity associated with the sending authorization policy permitting use of the `ReturnPath` address' },
|
|
63
|
+
Source: { ...str, comment: 'Identity email address sending the email; if omitted, a `From` address must be present in the raw message' },
|
|
64
|
+
SourceArn: { ...str, comment: 'ARN of the identity associated with the sending authorization policy permitting use of the `Source` address' },
|
|
65
|
+
Tags: { ...arr, comment: 'Array of `{ Name, Value }` message tags to apply to the email', ref: docRoot + 'API_MessageTag.html' },
|
|
66
|
+
},
|
|
67
|
+
request: async (params) => ({
|
|
68
|
+
headers: formEncodedContentType,
|
|
69
|
+
payload: qs.stringify(flattenParams({ Action: 'SendRawEmail', ...params })),
|
|
70
|
+
}),
|
|
71
|
+
response: ({ payload }) => payload.SendRawEmailResult,
|
|
72
|
+
error: defaultError,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
name: '@aws-lite/ses',
|
|
77
|
+
service,
|
|
78
|
+
property,
|
|
79
|
+
methods: {
|
|
80
|
+
SendEmail,
|
|
81
|
+
SendRawEmail,
|
|
82
|
+
...incomplete,
|
|
83
|
+
},
|
|
84
|
+
}
|
package/src/lib.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SES (v1) speaks the AWS query protocol (`application/x-www-form-urlencoded`).
|
|
3
|
+
* Nested objects flatten with `.`; lists use the `.member.N` (1-indexed) convention.
|
|
4
|
+
* This turns a natural JS params object into that flat, string-keyed shape, e.g.:
|
|
5
|
+
* { Destination: { ToAddresses: [ 'a@b.co' ] } }
|
|
6
|
+
* -> { 'Destination.ToAddresses.member.1': 'a@b.co' }
|
|
7
|
+
*/
|
|
8
|
+
export function flattenParams (obj, prefix, out) {
|
|
9
|
+
out = out || {}
|
|
10
|
+
for (const [ key, value ] of Object.entries(obj)) {
|
|
11
|
+
if (value === undefined || value === null) continue
|
|
12
|
+
const name = prefix ? `${prefix}.${key}` : key
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
value.forEach((item, i) => {
|
|
15
|
+
const memberName = `${name}.member.${i + 1}`
|
|
16
|
+
if (item !== null && typeof item === 'object') flattenParams(item, memberName, out)
|
|
17
|
+
else out[memberName] = item
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
else if (typeof value === 'object') {
|
|
21
|
+
flattenParams(value, name, out)
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
out[name] = value
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return out
|
|
28
|
+
}
|