@vleap/warps-adapter-fastset 0.1.0-beta.43 → 0.1.0-beta.44

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.
package/dist/index.js CHANGED
@@ -1432,12 +1432,23 @@ var FastsetClient = class {
1432
1432
  this.proxyUrl = proxyUrl;
1433
1433
  }
1434
1434
  async request(url, method, params) {
1435
- const request = this.buildJsonRpcRequest(id++, method, params);
1435
+ const requestId = id++;
1436
+ const request = this.buildJsonRpcRequest(requestId, method, params);
1436
1437
  const headers = { "Content-Type": "application/json" };
1437
1438
  const body = this.jsonSerialize(request);
1438
- const response = await fetch(url, { method: "POST", headers, body });
1439
- const json = await response.json();
1440
- return json;
1439
+ try {
1440
+ const response = await fetch(url, { method: "POST", headers, body });
1441
+ if (!response.ok) {
1442
+ return { jsonrpc: "2.0", id: requestId, error: { code: response.status, message: response.statusText } };
1443
+ }
1444
+ try {
1445
+ return await response.json();
1446
+ } catch {
1447
+ return { jsonrpc: "2.0", id: requestId, error: { code: -32700, message: "Parse error" } };
1448
+ }
1449
+ } catch {
1450
+ return { jsonrpc: "2.0", id: requestId, error: { code: -32603, message: "Internal error" } };
1451
+ }
1441
1452
  }
1442
1453
  buildJsonRpcRequest(id2, method, params) {
1443
1454
  return { jsonrpc: "2.0", id: id2, method, params };
@@ -1871,7 +1882,8 @@ var WarpFastsetOutput = class {
1871
1882
  values: { string: stringValues, native: rawValues, mapped: {} },
1872
1883
  output: {},
1873
1884
  messages: {},
1874
- destination: null
1885
+ destination: null,
1886
+ resolvedInputs: []
1875
1887
  };
1876
1888
  }
1877
1889
  async extractQueryOutput(warp, typedValues, actionIndex, inputs) {