@vario-software/vario-app-framework-backend 2026.14.1 → 2026.15.1

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.
@@ -41,6 +41,33 @@ const Webhook = class
41
41
  }),
42
42
  });
43
43
  };
44
+
45
+ getRegistered = async function()
46
+ {
47
+ const app = getApp();
48
+
49
+ const { data } = await this.ApiAdapter.vql({
50
+ statement: `
51
+ SELECT destinationQueue, url
52
+ FROM system.queryAppMessageWebhook
53
+ WHERE appIdentifier = '${app.client.appIdentifier}'
54
+ `,
55
+ });
56
+
57
+ return data || [];
58
+ };
59
+
60
+ isRegistered = async function(destinationQueue, url)
61
+ {
62
+ const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getRequest().get('host')}`}`;
63
+ const fullUrl = `${apiUrl}${url}`;
64
+
65
+ const registeredWebhooks = await this.getRegistered();
66
+
67
+ return registeredWebhooks.some(
68
+ webhook => webhook.destinationQueue === destinationQueue && webhook.url === fullUrl,
69
+ );
70
+ };
44
71
  };
45
72
 
46
73
  module.exports = Webhook;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vario-software/vario-app-framework-backend",
3
- "version": "2026.14.1",
3
+ "version": "2026.15.1",
4
4
  "repository": "https://github.com/vario-software/vario-app-framework",
5
5
  "author": "VARIO Software AG",
6
6
  "homepage": "https://www.vario.ag",
package/utils/migrator.js CHANGED
@@ -158,6 +158,26 @@ const Migrator = class
158
158
  await this.methods.log(`Webhook for destination "${destinationQueue}" deregistered\n`);
159
159
  },
160
160
 
161
+ isWebhookRegistered: async (destinationQueue, url) => this.ApiAdapter.webhook.isRegistered(destinationQueue, url),
162
+
163
+ registerWebhookIfNotExists: async (destinationQueue, url) =>
164
+ {
165
+ const isRegistered = await this.ApiAdapter.webhook.isRegistered(destinationQueue, url);
166
+
167
+ if (isRegistered)
168
+ {
169
+ await this.methods.log(`Webhook for destination "${destinationQueue}" already registered, skipping\n`);
170
+
171
+ return false;
172
+ }
173
+
174
+ await this.ApiAdapter.webhook.register(destinationQueue, url);
175
+
176
+ await this.methods.log(`Webhook for destination "${destinationQueue}" registered\n`);
177
+
178
+ return true;
179
+ },
180
+
161
181
  createSalesChannelBackend: async (label, validChannelTypes) =>
162
182
  {
163
183
  const { data: salesChannelBackend } = await this.ApiAdapter.fetch(`/community/${this.app.version}/erp/sales-channels/backend`, {