Giter Site home page Giter Site logo

Comments (5)

rubenkaiser avatar rubenkaiser commented on July 21, 2024

Hi, you're welcome. Had a quick look on my mobile and you are right. The AWS docs also state that your config is valid. The check you are referring to (.includes) should be replaced and check the type first (array or object). I will provide a fix in the coming days and keep you posted.

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on July 21, 2024

Hi, just published a beta release with a quick fix to see if it will work in your project. In this case the plugin only handles detail patterns one level deeper than previously. If this works I'll update the plugin later with a more robust solution that can handle all kinds of objects and depts.

https://www.npmjs.com/package/serverless-offline-aws-eventbridge/v/1.4.0-beta.1

from serverless-offline-eventbridge.

nason avatar nason commented on July 21, 2024

Hi @rubenkaiser thanks for the quick response. The beta version does work with the sample I posted!

Some of our other subscriptions are more nested, and those show the same issue. For example:

{
  source: ['graph'],
  'detail-type': ['update'],
  detail: {
    trigger: {
      // @ts-ignore: this is a valid pattern
      name: ['company'],

      event: {
        data: {
          new: {
            status: ['archived'],
          },
        },
      },
    },
  },
},

Please let me know if there is any way I can help!

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on July 21, 2024

Hi @nason. Good to see that the first test worked for you. I've just release a new beta version in which I had a go to fixing the more nested subscriptions. In this case I decided to flatten the subscription pattern, as well as the event detail. After that I've check if the event has the right properties.

You can see the solution in this PR (it also has some husky stuff, but you can ignore that)
#13

I think this is a nice generic solution that works very well. Can you check it in your setup?

https://www.npmjs.com/package/serverless-offline-aws-eventbridge/v/1.4.0-beta.2

from serverless-offline-eventbridge.

rubenkaiser avatar rubenkaiser commented on July 21, 2024

Fixed by #13

from serverless-offline-eventbridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.