Shopware 6 node on github

To get familiar with node.js, Typescript and n8n I developed a shopware node. I’ll continue my work in the next couple of days but I am eager to get some feedback.

At the moment there is read and delete support as well as a trigger node. For read and delete the endpoints and entities are loaded dynamically from shopware out of the schema and api definition.

Have a look and I am very much open for critique:

1 Like

Really cool @Axel! Thanks a lot. Looking forward merging it.

I just had a short look through the code. Did not run it as I do not have Shopware but here a few things I saw:

  • Try to follow existing n8n formatting like single quotes instead of double quotes, trailing commas, …
  • It looks like you are manually implementing some oauth functionality. That should not be necessary because we have abstracted that away. Maybe check with existing nodes how it is implemented there.
  • “IDs” parameter for get. You allow defining multiple ones by having them in separate lines. That is not wrong but we normally do that comma separated. So to stay consistent should that be changed to work the same.
  • for “getAll” do you have the “page” parameter. To make it easy for users do we always abstract that away. People can always choose between a max number of results to return or returning everything. n8n does the pagination then automatically under the hood.
  • there are multiple locations where you catch errors and then throw the caught error again. That can get removed as it actually does nothing.
  • always sort options alphabetically like for example the topics. At least unless there is a logical reason to have it in a different one.

I hope that is helpful.

Thank you for the feedback! Some habits from PHP coding die hard.

A few commets:

  1. You can get a shopware 6 cloud account - it also provides a demo mode with test data.
  2. Shopware only implements client_credentials oauth2, similar to paypal. This is why the “standard” oAuth-client implementation does not help. There is no authentication-process in the first place.

I added a lot to the node. E.g.:

  1. Creation of assets, products, etc.
  2. Especially the products are very complex - with assigning assets, brand, tax, etc.
  3. The definition of the entities for creation is mostly done via reflection - this means that new entity types can be added via adding the form fields and the corresponding class.
  4. I added two example workflows.

I proper code review has to be done and there is so much more todo. But for now I don’t have time for this.