@pinelab/vendure-plugin-webhook 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 1.3.0 (2024-12-19)
2
+
3
+ - Update Vendure to 3.1.1
4
+
5
+ # 1.2.2 (2024-08-04)
6
+
7
+ - Update compatibility range (#480)
8
+
1
9
  # 1.2.1 (2024-06-26)
2
10
 
3
11
  - Extended transformer function with webhook entity to make the event name accessible
package/README.md CHANGED
@@ -69,7 +69,13 @@ export const stringifyProductTransformer = new RequestTransformer({
69
69
  transform: (event, injector, webhook) => {
70
70
  if (event instanceof ProductEvent) {
71
71
  return {
72
- body: JSON.stringify({ event: webhook.event, ...event }), // Pass the event name to the body
72
+ body: JSON.stringify({
73
+ type: webhook.event, // Name of the event ("ProductEvent")
74
+ event: {
75
+ ...event,
76
+ ctx: undefined, // Remove ctx or use event.ctx.serialize()
77
+ },
78
+ }),
73
79
  headers: {
74
80
  authorization: 'Bearer MyToken',
75
81
  'x-custom-header': 'custom-example-header',
@@ -68,6 +68,6 @@ exports.WebhookPlugin = WebhookPlugin = WebhookPlugin_1 = __decorate([
68
68
  config.authOptions.customPermissions.push(webhook_resolver_1.webhookPermission);
69
69
  return config;
70
70
  },
71
- compatibility: '^2.0.0',
71
+ compatibility: '>=2.2.0',
72
72
  })
73
73
  ], WebhookPlugin);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinelab/vendure-plugin-webhook",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Call webhooks based on configured events from Vendure",
5
5
  "author": "Martijn van de Brug <martijn@pinelab.studio>",
6
6
  "homepage": "https://pinelab-plugins.com/",
@@ -23,5 +23,5 @@
23
23
  "test": "vitest run",
24
24
  "lint": "echo 'No linting configured'"
25
25
  },
26
- "gitHead": "89ac3a3a6e1d156b43cd5d65a01ee057bd2ee43a"
26
+ "gitHead": "9c5bcd59af3ebeb3287084e495d7c5c359cf5d40"
27
27
  }