dav*_*arg 22 javascript amazon-web-services amazon-ses aws-sdk-js
我对 SES 和 SESV2 之间 javascript aws-sdk 的差异感到困惑。我的默认假设是 V2 是升级/更新,应该涵盖基本 SES 模块具有的所有功能,但似乎存在很多差距,至少那些处理收据规则集的功能似乎缺失。或者我错过了什么?
例如,“listReceiptRuleSets”位于 aws-sdk SES 中,但不在 SESv2 中。V2中有类似的动作吗?
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html#listReceiptRuleSets-property
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SESV2.html
使用这个答案作为指导,我写了以下内容
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
AWS.config.apiVersions = {
sesv1: '2010-12-01',
sesv2: '2019-09-27'
};
var sesv1 = new AWS.SES();
var sesv2 = new AWS.SESV2();
//list intance methods
console.log(Object.getOwnPropertyNames(Object.getPrototypeOf(sesv1))
.filter(m => 'function' === typeof sesv1[m]))
console.log(Object.getOwnPropertyNames(Object.getPrototypeOf(sesv2))
.filter(m => 'function' === typeof sesv2[m]))
Run Code Online (Sandbox Code Playgroud)
用节点运行这个,是的,有很大的区别:
v1:
[
'constructor',
'cloneReceiptRuleSet',
'createConfigurationSet',
'createConfigurationSetEventDestination',
'createConfigurationSetTrackingOptions',
'createCustomVerificationEmailTemplate',
'createReceiptFilter',
'createReceiptRule',
'createReceiptRuleSet',
'createTemplate',
'deleteConfigurationSet',
'deleteConfigurationSetEventDestination',
'deleteConfigurationSetTrackingOptions',
'deleteCustomVerificationEmailTemplate',
'deleteIdentity',
'deleteIdentityPolicy',
'deleteReceiptFilter',
'deleteReceiptRule',
'deleteReceiptRuleSet',
'deleteTemplate',
'deleteVerifiedEmailAddress',
'describeActiveReceiptRuleSet',
'describeConfigurationSet',
'describeReceiptRule',
'describeReceiptRuleSet',
'getAccountSendingEnabled',
'getCustomVerificationEmailTemplate',
'getIdentityDkimAttributes',
'getIdentityMailFromDomainAttributes',
'getIdentityNotificationAttributes',
'getIdentityPolicies',
'getIdentityVerificationAttributes',
'getSendQuota',
'getSendStatistics',
'getTemplate',
'listConfigurationSets',
'listCustomVerificationEmailTemplates',
'listIdentities',
'listIdentityPolicies',
'listReceiptFilters',
'listReceiptRuleSets',
'listTemplates',
'listVerifiedEmailAddresses',
'putConfigurationSetDeliveryOptions',
'putIdentityPolicy',
'reorderReceiptRuleSet',
'sendBounce',
'sendBulkTemplatedEmail',
'sendCustomVerificationEmail',
'sendEmail',
'sendRawEmail',
'sendTemplatedEmail',
'setActiveReceiptRuleSet',
'setIdentityDkimEnabled',
'setIdentityFeedbackForwardingEnabled',
'setIdentityHeadersInNotificationsEnabled',
'setIdentityMailFromDomain',
'setIdentityNotificationTopic',
'setReceiptRulePosition',
'testRenderTemplate',
'updateAccountSendingEnabled',
'updateConfigurationSetEventDestination',
'updateConfigurationSetReputationMetricsEnabled',
'updateConfigurationSetSendingEnabled',
'updateConfigurationSetTrackingOptions',
'updateCustomVerificationEmailTemplate',
'updateReceiptRule',
'updateTemplate',
'verifyDomainDkim',
'verifyDomainIdentity',
'verifyEmailAddress',
'verifyEmailIdentity'
]
Run Code Online (Sandbox Code Playgroud)
v2:
[
'constructor',
'createConfigurationSet',
'createConfigurationSetEventDestination',
'createContact',
'createContactList',
'createCustomVerificationEmailTemplate',
'createDedicatedIpPool',
'createDeliverabilityTestReport',
'createEmailIdentity',
'createEmailIdentityPolicy',
'createEmailTemplate',
'createImportJob',
'deleteConfigurationSet',
'deleteConfigurationSetEventDestination',
'deleteContact',
'deleteContactList',
'deleteCustomVerificationEmailTemplate',
'deleteDedicatedIpPool',
'deleteEmailIdentity',
'deleteEmailIdentityPolicy',
'deleteEmailTemplate',
'deleteSuppressedDestination',
'getAccount',
'getBlacklistReports',
'getConfigurationSet',
'getConfigurationSetEventDestinations',
'getContact',
'getContactList',
'getCustomVerificationEmailTemplate',
'getDedicatedIp',
'getDedicatedIps',
'getDeliverabilityDashboardOptions',
'getDeliverabilityTestReport',
'getDomainDeliverabilityCampaign',
'getDomainStatisticsReport',
'getEmailIdentity',
'getEmailIdentityPolicies',
'getEmailTemplate',
'getImportJob',
'getSuppressedDestination',
'listConfigurationSets',
'listContactLists',
'listContacts',
'listCustomVerificationEmailTemplates',
'listDedicatedIpPools',
'listDeliverabilityTestReports',
'listDomainDeliverabilityCampaigns',
'listEmailIdentities',
'listEmailTemplates',
'listImportJobs',
'listSuppressedDestinations',
'listTagsForResource',
'putAccountDedicatedIpWarmupAttributes',
'putAccountDetails',
'putAccountSendingAttributes',
'putAccountSuppressionAttributes',
'putConfigurationSetDeliveryOptions',
'putConfigurationSetReputationOptions',
'putConfigurationSetSendingOptions',
'putConfigurationSetSuppressionOptions',
'putConfigurationSetTrackingOptions',
'putDedicatedIpInPool',
'putDedicatedIpWarmupAttributes',
'putDeliverabilityDashboardOption',
'putEmailIdentityConfigurationSetAttributes',
'putEmailIdentityDkimAttributes',
'putEmailIdentityDkimSigningAttributes',
'putEmailIdentityFeedbackAttributes',
'putEmailIdentityMailFromAttributes',
'putSuppressedDestination',
'sendBulkEmail',
'sendCustomVerificationEmail',
'sendEmail',
'tagResource',
'testRenderEmailTemplate',
'untagResource',
'updateConfigurationSetEventDestination',
'updateContact',
'updateContactList',
'updateCustomVerificationEmailTemplate',
'updateEmailIdentityPolicy',
'updateEmailTemplate'
]
Run Code Online (Sandbox Code Playgroud)
如果您依赖仅存在于 v1 中的方法,我建议您继续使用 v1。如果您发现必须使用 v2 中的方法,那么您将必须构建 v2 的实例并将其与 v1 对象一起使用。