Skip to content
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

source not present in EventBridge subscription response type #773

Open
Tohaker opened this issue Aug 5, 2024 · 5 comments
Open

source not present in EventBridge subscription response type #773

Tohaker opened this issue Aug 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Tohaker
Copy link

Tohaker commented Aug 5, 2024

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
@Tohaker Tohaker added the bug Something isn't working label Aug 5, 2024
@ajimae ajimae self-assigned this Aug 5, 2024
@jenschude
Copy link
Contributor

The field source is not documented and should not be used.

https://docs.commercetools.com/api/projects/subscriptions#eventbridgedestination

@Tohaker
Copy link
Author

Tohaker commented Aug 5, 2024

@jenschude
Copy link
Contributor

Oh nice catch. I will forward it to the respective team if it should be public and then be documented or not.

@Tohaker
Copy link
Author

Tohaker commented Oct 22, 2024

@jenschude Has there been any update on this?

@jenschude
Copy link
Contributor

Hi.

The source field will be added in the next release

https://github.com/commercetools/commercetools-sdk-typescript/pull/831/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants