commercetools-sdk-typescript
commercetools-sdk-typescript copied to clipboard
`source` not present in EventBridge subscription response type
Describe the bug
When creating or getting a subscription with sdk-client-v2 that targets EventBridge, the response has the source property under destination but the type omits this field.
To Reproduce Observe the types in https://github.com/commercetools/commercetools-sdk-typescript/blob/master/packages/platform-sdk/src/generated/models/subscription.ts#L254
Expected behavior
The source field should be string | undefined
Screenshots/Code snippet
const subscription = await client.requestBuilder
.subscriptions()
.withKey({ key })
.get()
.execute();
if (
subscription.statusCode === 200 &&
subscription.body.destination.type === "EventBridge"
) {
// @ts-ignore The EventBridge destination has a source field
return subscription.body.destination.source as string;
}
Stack information (please complete the following information):
- Node: 20
- SDK: 2.5.0