-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add SNS support #35
base: main
Are you sure you want to change the base?
Conversation
src/index.ts
Outdated
`PublishBatchRequestEntries.${k}.${i}`, | ||
// `PublishBatchRequestEntries.${k}.${i + 1}`, | ||
// `PublishBatchRequestEntry.${i + 1}.${k}`, | ||
// `PublishBatchRequestEntries.${i + 1}.${k}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these valid? Are we supporting all possible cases or a subset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the PR was meant to be a draft, there's many things I need to clean up first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally found the format for arrays. It's literally PublishBatchRequestEntries.member.${i + 1}.${memberKey}
.
return {}; | ||
} | ||
|
||
const formatResultXmlElement = (element: XmlElement) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a link to the schema we can include here for reference?
How comprehensive is this passing logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where I look for reference: https://docs.aws.amazon.com/sns/latest/api/API_Operations.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've seen, there's two types of responses. The simple ones (eg, Publish):
<PublishResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
<PublishResult>
<MessageId>567910cd-659e-55d4-8ccb-5aaf14679dc0</MessageId>
</PublishResult>
<ResponseMetadata>
<RequestId>d74b8436-ae13-5ab4-a9ff-ce54dfea72a0</RequestId>
</ResponseMetadata>
</PublishResponse>
Which is most of the actions, and they always look like this:
<{action}Response>
<{action}Result>
<{key}>{value}</{key}>
</{action}Result>
</{action}Response>
But there's also GetTopicAttributes which looks like this:
<GetTopicAttributesResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
<GetTopicAttributesResult>
<Attributes>
<entry>
<key>Owner</key>
<value>123456789012</value>
</entry>
<entry>
<key>Policy</key>
<value>...</value>
</entry>
<entry>
<key>TopicArn</key>
<value>arn:aws:sns:us-east-2:123456789012:My-Topic</value>
</entry>
</Attributes>
</GetTopicAttributesResult>
<ResponseMetadata>
<RequestId>057f074c-33a7-11df-9540-99d0768312d3</RequestId>
</ResponseMetadata>
</GetTopicAttributesResponse>
Maybe there's more types, though.
Added the following tests:
I think all API endpoints will work since it seems pretty consistent. |
Basic implementation adding SNS support.