@vida-global/apps-tools 1.0.6 → 1.0.8

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.
@@ -23,7 +23,11 @@ class VaderApiClient extends HttpClient {
23
23
  };
24
24
 
25
25
  const { data } = await this.post(endpoint, userContext, body);
26
- return data.data;
26
+ if (data.data) {
27
+ return data.data;
28
+ } else {
29
+ return data;
30
+ }
27
31
  }
28
32
 
29
33
 
@@ -48,16 +52,21 @@ class VaderApiClient extends HttpClient {
48
52
 
49
53
 
50
54
  async #invokeAction(actionType, responseCls, app, actionName, actionArgs, userContext) {
51
- const endpoint = `/invoke/app/${actionType}/${app.id()}/${app.version()}/${actionName}`
55
+ const endpoint = `/invoke/app/${actionType}/${app.id()}/${app.version()}/${actionName}`
56
+ const argsParamName = `${actionType}Args`;
52
57
  const body = {
53
- userContext: userContext?.toDict() || null,
54
- appManifest: await app.getCompositeManifest(),
55
- actionArgs,
58
+ userContext: userContext?.toDict() || null,
59
+ appManifest: await app.getCompositeManifest(),
60
+ [argsParamName]: actionArgs,
56
61
  };
57
62
 
58
63
  try {
59
64
  const { data } = await this.post(endpoint, userContext, body);
60
- return data.data;
65
+ if (data.data) {
66
+ return data.data;
67
+ } else {
68
+ return data;
69
+ }
61
70
  } catch(err) {
62
71
  const appResponse = new responseCls();
63
72
  appResponse.status = "error"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vida-global/apps-tools",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Classes for creating vida apps",
5
5
  "author": "",
6
6
  "license": "ISC",