@lowdefy/engine 0.0.0-experimental-20241107144205 → 0.0.0-experimental-20241205084114

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.
@@ -27,21 +27,14 @@ async function callAPIHandler(context, { blockId, params }) {
27
27
  endTimestamp: null
28
28
  };
29
29
  context._internal.lowdefy.apiResponses[api.endpointId].unshift(api);
30
+ let apiResponse;
30
31
  try {
31
- const { error, response, status, success } = await context._internal.lowdefy._internal.callAPI({
32
+ apiResponse = await context._internal.lowdefy._internal.callAPI({
32
33
  blockId: api.blockId,
33
34
  pageId: context.pageId,
34
35
  payload: serializer.serialize(api.payload),
35
36
  endpointId: api.endpointId
36
37
  });
37
- api.error = serializer.deserialize(error);
38
- api.loading = false;
39
- api.response = serializer.deserialize(response);
40
- api.status = status;
41
- api.success = success;
42
- api.endTimestamp = new Date();
43
- api.responseTime = api.endTimestamp - api.startTimestamp;
44
- context._internal.update();
45
38
  } catch (error) {
46
39
  api.error = error;
47
40
  api.loading = false;
@@ -53,6 +46,18 @@ async function callAPIHandler(context, { blockId, params }) {
53
46
  context._internal.update();
54
47
  throw error;
55
48
  }
49
+ const { error, response, status, success } = apiResponse;
50
+ api.error = serializer.deserialize(error);
51
+ api.loading = false;
52
+ api.response = serializer.deserialize(response);
53
+ api.status = status;
54
+ api.success = success;
55
+ api.endTimestamp = new Date();
56
+ api.responseTime = api.endTimestamp - api.startTimestamp;
57
+ context._internal.update();
58
+ if (!success) {
59
+ throw serializer.deserialize(error);
60
+ }
56
61
  return api;
57
62
  }
58
63
  export default callAPIHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/engine",
3
- "version": "0.0.0-experimental-20241107144205",
3
+ "version": "0.0.0-experimental-20241205084114",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -30,15 +30,15 @@
30
30
  "dist/*"
31
31
  ],
32
32
  "dependencies": {
33
- "@lowdefy/helpers": "0.0.0-experimental-20241107144205",
34
- "@lowdefy/operators": "0.0.0-experimental-20241107144205"
33
+ "@lowdefy/helpers": "0.0.0-experimental-20241205084114",
34
+ "@lowdefy/operators": "0.0.0-experimental-20241205084114"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@jest/globals": "28.1.3",
38
- "@lowdefy/actions-core": "0.0.0-experimental-20241107144205",
39
- "@lowdefy/build": "0.0.0-experimental-20241107144205",
40
- "@lowdefy/operators-js": "0.0.0-experimental-20241107144205",
41
- "@lowdefy/operators-mql": "0.0.0-experimental-20241107144205",
38
+ "@lowdefy/actions-core": "0.0.0-experimental-20241205084114",
39
+ "@lowdefy/build": "0.0.0-experimental-20241205084114",
40
+ "@lowdefy/operators-js": "0.0.0-experimental-20241205084114",
41
+ "@lowdefy/operators-mql": "0.0.0-experimental-20241205084114",
42
42
  "@swc/cli": "0.1.63",
43
43
  "@swc/core": "1.3.99",
44
44
  "@swc/jest": "0.2.29",