@vario-software/vario-app-framework-backend 2026.21.0 → 2026.22.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.
@@ -1,4 +1,4 @@
1
- async function vql({ statement, variableSubstitutions = [], limit = null, offset = null })
1
+ async function vql({ statement, variableSubstitutions = [], limit = null, offset = null, mapDisplayNames = true })
2
2
  {
3
3
  const payload = {
4
4
  statement,
@@ -24,7 +24,9 @@ async function vql({ statement, variableSubstitutions = [], limit = null, offset
24
24
 
25
25
  return {
26
26
  ...result.data,
27
- data: mapDisplayName(result.data.definition, result.data.data),
27
+ data: mapDisplayNames
28
+ ? mapDisplayName(result.data.definition, result.data.data)
29
+ : result.data.data,
28
30
  moreElements: result.response.headers['x-query-more-elements'],
29
31
  nextOffset: result.response.headers['x-query-next-offset'],
30
32
  };
@@ -1,4 +1,4 @@
1
- const { getRequest } = require('#backend/utils/context.js');
1
+ const { getAppDomain } = require('#backend/utils/context.js');
2
2
  const { getApp } = require('#backend/utils/context.js');
3
3
 
4
4
  const Webhook = class
@@ -10,7 +10,7 @@ const Webhook = class
10
10
 
11
11
  register = async function(destinationQueue, url, destinationOwner)
12
12
  {
13
- const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getRequest().get('host')}`}`;
13
+ const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getAppDomain()}`}`;
14
14
 
15
15
  const app = getApp();
16
16
 
@@ -27,7 +27,7 @@ const Webhook = class
27
27
 
28
28
  deregister = async function(destinationQueue, url, destinationOwner)
29
29
  {
30
- const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getRequest().get('host')}`}`;
30
+ const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getAppDomain()}`}`;
31
31
 
32
32
  const app = getApp();
33
33
 
@@ -59,7 +59,7 @@ const Webhook = class
59
59
 
60
60
  isRegistered = async function(destinationQueue, url)
61
61
  {
62
- const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getRequest().get('host')}`}`;
62
+ const apiUrl = `${process.env.WEBHOOK_HOST ?? `https://${getAppDomain()}`}`;
63
63
  const fullUrl = `${apiUrl}${url}`;
64
64
 
65
65
  const registeredWebhooks = await this.getRegistered();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vario-software/vario-app-framework-backend",
3
- "version": "2026.21.0",
3
+ "version": "2026.22.0",
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/context.js CHANGED
@@ -33,6 +33,13 @@ function getTenant()
33
33
  return tenant;
34
34
  }
35
35
 
36
+ function getAppDomain()
37
+ {
38
+ const appDomain = getAccessToken()?.appDomain;
39
+
40
+ return appDomain;
41
+ }
42
+
36
43
  function getExternalUserId()
37
44
  {
38
45
  const externalUserId = getAccessToken()?.sub;
@@ -72,6 +79,7 @@ module.exports = {
72
79
  getContext,
73
80
  getAppToken,
74
81
  getAccessToken,
82
+ getAppDomain,
75
83
  getTenant,
76
84
  getExternalUserId,
77
85
  getRequest,
package/utils/migrator.js CHANGED
@@ -211,21 +211,35 @@ const Migrator = class
211
211
 
212
212
  createSalesChannel: async (salesChannelBackend, label, description, channelType = 'ECOMMERCE') =>
213
213
  {
214
- const { data: salesChannel } = await this.ApiAdapter.fetch(`/community/${this.app.version}/erp/sales-channels`, {
215
- method: 'POST',
216
- body: JSON.stringify({
217
- label,
218
- description,
219
- active: true,
220
- channelType,
221
- channelBackend: { id: salesChannelBackend.id },
222
- externalRef: '',
223
- }),
224
- });
214
+ try
215
+ {
216
+ const { data: salesChannel } = await this.ApiAdapter.fetch(`/community/${this.app.version}/erp/sales-channels`, {
217
+ method: 'POST',
218
+ body: JSON.stringify({
219
+ label,
220
+ description,
221
+ active: true,
222
+ channelType,
223
+ channelBackend: { id: salesChannelBackend.id },
224
+ externalRef: '',
225
+ }),
226
+ });
225
227
 
226
- await this.methods.log(`Sales-Channel with id "${salesChannel.id}" successfully created\n`);
228
+ await this.methods.log(`Sales-Channel with id "${salesChannel.id}" successfully created\n`);
227
229
 
228
- return salesChannel;
230
+ return salesChannel;
231
+ }
232
+ catch (error)
233
+ {
234
+ if (error.statusCode === 402)
235
+ {
236
+ await this.methods.log('Missing Sales-Channel license\n', 'WARNING');
237
+
238
+ return {};
239
+ }
240
+
241
+ throw error;
242
+ }
229
243
  },
230
244
 
231
245
  getSalesChannels: async () =>