@vida-global/apps-tools 1.0.4 → 1.0.6

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.
@@ -22,8 +22,8 @@ class VaderApiClient extends HttpClient {
22
22
  functionArgs,
23
23
  };
24
24
 
25
- const response = await this.post(endpoint, userContext, body);
26
- return response.data;
25
+ const { data } = await this.post(endpoint, userContext, body);
26
+ return data.data;
27
27
  }
28
28
 
29
29
 
@@ -56,8 +56,8 @@ class VaderApiClient extends HttpClient {
56
56
  };
57
57
 
58
58
  try {
59
- const response = await this.post(endpoint, userContext, body);
60
- return response.data;
59
+ const { data } = await this.post(endpoint, userContext, body);
60
+ return data.data;
61
61
  } catch(err) {
62
62
  const appResponse = new responseCls();
63
63
  appResponse.status = "error"
@@ -56,10 +56,13 @@ class AppController extends VidaServerController {
56
56
 
57
57
 
58
58
  async invokeAppManager() {
59
- const { functionArgs,
60
- functionName,
61
- userContext } = this.params
62
- const context = this.appManager.context(userContext);
59
+ let { functionArgs,
60
+ functionName,
61
+ userContext } = this.params
62
+ const context = this.appManager.context(userContext);
63
+
64
+ if (!Array.isArray(functionArgs)) functionArgs = [functionArgs];
65
+
63
66
  let resp = await context[functionName](...functionArgs)
64
67
  if (resp.serialize && typeof resp.serialize === 'function') {
65
68
  resp = await resp.serialize()
@@ -3,7 +3,7 @@ const swaggerUi = require("swagger-ui-express");
3
3
  const { VidaServer, logger } = require('@vida-global/core');
4
4
 
5
5
 
6
- class AppServer extends VidaServer{
6
+ class AppServer extends VidaServer {
7
7
  #appManager;
8
8
  #apps;
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vida-global/apps-tools",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Classes for creating vida apps",
5
5
  "author": "",
6
6
  "license": "ISC",